Skip to content

Instantly share code, notes, and snippets.

@rmwpl
Created September 15, 2017 07:33
Show Gist options
  • Save rmwpl/afb6db1d8466c147eb40554a9598e491 to your computer and use it in GitHub Desktop.
Save rmwpl/afb6db1d8466c147eb40554a9598e491 to your computer and use it in GitHub Desktop.
docker scraps
TOKEN="`curl -s -u <username>:<password> 'https://auth.docker.io/token?service=registry.docker.io&scope=repository:monterail/solarcapture-server:pull' | jq -r .token`"
DOWNSTREAM_DIGEST=$(curl -v -H "Accept: application/vnd.docker.distribution.manifest.v2+json" -H "Authorization: Bearer ${TOKEN}" https://index.docker.io/v2/monterail/solarcapture-server/manifests/latest 2>&1 | grep 'Docker-Content-Digest' | cut -d' ' -f3)
docker inspect localhost:5000/server/server:latest | jq -r ".[].RepoDigests | .[] | endswith(\"${REMOTE_DIGEST}\")"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment