Skip to content

Instantly share code, notes, and snippets.

@achimnol
Created January 22, 2019 06:56
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 achimnol/403cff0430c0b25c73145ebf11b7a567 to your computer and use it in GitHub Desktop.
Save achimnol/403cff0430c0b25c73145ebf11b7a567 to your computer and use it in GitHub Desktop.
Reading Docker image labels from registry
IMAGE=lablup/kernel-python
TAG=3.6-ubuntu18.04
TOKEN=$(curl -s "https://auth.docker.io/token?scope=repository:$IMAGE:pull&service=registry.docker.io" | jq -r .token)
CONFIG_DIGEST=$(curl -s -H"Accept: application/vnd.docker.distribution.manifest.v2+json" -H"Authorization: Bearer $TOKEN" "https://registry-1.docker.io/v2/$IMAGE/manifests/$TAG" | jq -r .config.digest)
RESULT=$(curl -sL -H"Authorization: Bearer $TOKEN" "https://registry-1.docker.io/v2/$IMAGE/blobs/$CONFIG_DIGEST" | jq -r .container_config.Labels)
echo $RESULT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment