Skip to content

Instantly share code, notes, and snippets.

@kmassada
Created May 19, 2021 21:07
Show Gist options
  • Select an option

  • Save kmassada/7752d4f20e09018cd4c614cb7d9ebe89 to your computer and use it in GitHub Desktop.

Select an option

Save kmassada/7752d4f20e09018cd4c614cb7d9ebe89 to your computer and use it in GitHub Desktop.

Revisions

  1. kmassada created this gist May 19, 2021.
    8 changes: 8 additions & 0 deletions Docker HTTP REST API
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    REGISTRY=https://index.docker.io/v2
    REPO=library
    IMAGE=debian
    TAG=latest

    TOKEN=$(curl -sSL "https://auth.docker.io/token?service=registry.docker.io&scope=repository:$REPO/$IMAGE:pull" \
    | jq --raw-output .token)
    curl -LH "Authorization: Bearer ${TOKEN}" "$REGISTRY/$REPO/$IMAGE/manifests/$TAG"