Skip to content

Instantly share code, notes, and snippets.

@lrewega
Created April 22, 2020 21:52
Show Gist options
  • Save lrewega/f73ee194afba3ad5a9fae95e0c1d9dfa to your computer and use it in GitHub Desktop.
Save lrewega/f73ee194afba3ad5a9fae95e0c1d9dfa to your computer and use it in GitHub Desktop.
spelunking for files in a docker image
REPO=whatever/youwant; curl -sSL -H "Authorization: Bearer $(curl -sSL "https://auth.docker.io/token?service=registry.docker.io&scope=repository:${REPO}:pull" | jq -r .token)" -H 'Accept: application/vnd.docker.distribution.manifest.v2+json' "https://registry-1.docker.io/v2/${REPO}/manifests/latest" | jq -r '.layers[].digest' | while read digest; do curl -sSL -H "Authorization: Bearer $(curl -sSL "https://auth.docker.io/token?service=registry.docker.io&scope=repository:${REPO}:pull" | jq -r .token)" "https://registry-1.docker.io/v2/${REPO}/blobs/${digest}" | tar -tz | sed "s/^/${digest##*:}\t/"; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment