Skip to content

Instantly share code, notes, and snippets.

@jasonmcintosh
Last active August 23, 2022 21:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jasonmcintosh/59e67aa0e1634a0a33d7a2d331b08ebb to your computer and use it in GitHub Desktop.
Save jasonmcintosh/59e67aa0e1634a0a33d7a2d331b08ebb to your computer and use it in GitHub Desktop.
Docker API with CURL
## This is an example, note hte scope on the auth piece - THIS IS GENERATED PER REPO.
## Requires JQ to be installed
export IMAGE="armory/clouddriver"
export TOKEN=$(curl https://auth.docker.io/token\?scope\=repository:$IMAGE:pull\&service\=registry.docker.io | jq -r .token)
curl -v -H "Accept: application/vnd.docker.distribution.manifest.v2+json" -H "Accept: application/vnd.docker.distribution.manifest.list.v2+json" -H "Authorization: Bearer $TOKEN" https://index.docker.io/v2/$IMAGE/tags/list
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment