Skip to content

Instantly share code, notes, and snippets.

@neklaf
Last active March 19, 2020 21:23
Show Gist options
  • Save neklaf/b6a4b3c2643ca684e3f6d709d70381e3 to your computer and use it in GitHub Desktop.
Save neklaf/b6a4b3c2643ca684e3f6d709d70381e3 to your computer and use it in GitHub Desktop.
Inspecting a docker image

Pull the docker image to inspect and save it as a tar file:

docker pull gcr.io/distroless/base-debian10:latest`
docker image save gcr.io/distroless/base-debian10:latest > distroless.tar
mkdir distroless && cd distroless
tar xvf distroless.tar
x 0032743b1e18b361a1fd10656b43c18ec1704ec372242f4baf40b06364fb6c49/
x 0032743b1e18b361a1fd10656b43c18ec1704ec372242f4baf40b06364fb6c49/VERSION
x 0032743b1e18b361a1fd10656b43c18ec1704ec372242f4baf40b06364fb6c49/json
x 0032743b1e18b361a1fd10656b43c18ec1704ec372242f4baf40b06364fb6c49/layer.tar
x 22aa758f50de1b80f56c584cf246ddb30f68d52bd65e0f61f6a3b2353ef95700/
x 22aa758f50de1b80f56c584cf246ddb30f68d52bd65e0f61f6a3b2353ef95700/VERSION
x 22aa758f50de1b80f56c584cf246ddb30f68d52bd65e0f61f6a3b2353ef95700/json
x 22aa758f50de1b80f56c584cf246ddb30f68d52bd65e0f61f6a3b2353ef95700/layer.tar
x 5bb0e81ff6e4fdc17385f90536d699da9405f5a974a3ae6d0eeef9e8c6ef2917.json
x manifest.json
x repositories

Let's extract all layers content:

find . -iname layer.tar -exec tar xvf {} \;

List all files in the layers:

find . -type f -print

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment