Skip to content

Instantly share code, notes, and snippets.

@orphaner
Forked from tuxfight3r/notes.MD
Created October 24, 2018 20:33
Show Gist options
  • Select an option

  • Save orphaner/340cb6f16f07857f5dd241a2d37fb809 to your computer and use it in GitHub Desktop.

Select an option

Save orphaner/340cb6f16f07857f5dd241a2d37fb809 to your computer and use it in GitHub Desktop.
docker registry tricks with skopeo and curl

Authentication in the registry can be provided by docker/skopeo

docker login -u admin https://docker-registry-default.apps1.ew1.aws.domain.local

or 

#skopeo uses the password from this file ~/.docker/config.json

Inspect the available tags

skopeo inspect docker://docker-registry-default.apps1.ew1.aws.domain.local/test-matteo-master/bdd-watch

Inspect a specific Tag

skopeo inspect docker://docker-registry-default.apps1.ew1.aws.domain.local/test-matteo-master/bdd-watch:0.1.0

Delete a specific tag

skopeo --debug delete docker://docker-registry-default.apps1.ew1.aws.domain.local/test-matteo-master/bdd-watch:0.1.0

copy a specific image from one registry to other registry

skopeo --debug copy docker://docker-registry-default.apps1.ew1.aws.domain.local/bdd-watch-test/bdd-watch:0.1.0  \
                    docker://docker-registry-default.apps2.ew1.aws.domain.local/bdd-watch-test/bdd-watch:0.1.0

curl tricks with Registry

# list all available tags for that iamge
curl -v -H "Authorization: Bearer $(oc whoami -t)"  \
 https://docker-registry-default.apps1.ew1.aws.domain.local/v2/test-matteo-master/bdd-watchlist/tags/list

# list the latest manifest info for that iamge
curl -v -H "Authorization: Bearer $(oc whoami -t)"  \
 https://docker-registry-default.apps1.ew1.aws.domain.local/v2/test-matteo-master/bdd-watchlist/manifests/latest
 
# list the specific tag manifest info for that iamge
curl -v -H "Authorization: Bearer $(oc whoami -t)"  \
 https://docker-registry-default.apps1.ew1.aws.domain.local/v2/test-matteo-master/bdd-watchlist/manifests/0.18.0 
 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment