Project idea: a Google for docker images. Search for files by hash within all public docker images. Find images that contain a certain piece of code. Reverse engineering Dockerfiles for those that were built without.
Dive – A tool for exploring each layer in a Docker image
21–30 of 45 posts
Re: Dive – A tool for exploring each layer in a Docker image
#22Re: Dive – A tool for exploring each layer in a Docker image
#23Can someone well versed in Docker explain in their own words what this does and why it is useful? Thanks in advance! I'm definitely not a docker poweruser...other than build start and stopping..
This project takes an image and shows the list of layers (=commits) and for each layer (=commit) allow you to see what was changed (=the diff).
A bit like a git log for a docker image.
Re: Dive – A tool for exploring each layer in a Docker image
#24Re: Dive – A tool for exploring each layer in a Docker image
#25Re: Dive – A tool for exploring each layer in a Docker image
#26Project idea: a Google for docker images. Search for files by hash within all public docker images. Find images that contain a certain piece of code. Reverse engineering Dockerfiles for those that were built without.
Every layer understands the command it was run in the Dockerfile to create itself. Just look at `docker history` and have a look at the "CREATED BY" field for human-readable output of the layer metadata, or depending on your graph driver have a look in /var/lib/docker/image/overlay2/imagedb/content/sha256. From there you can reverse-engineer a Dockerfile.
For layers that were not built using `docker build` (e.g. `docker commit`, OCI-compatible image builders), re-creating the exact command that generated that layer is much harder to do. The only information most tools will give you might just be the diff itself.
Re: Dive – A tool for exploring each layer in a Docker image
#27Is there a tool to compare 2 or more images to check which layers they have in common?
This requires that you have logged in to the registry, pushed the image to the registry and have `docker pull` rights for the image. You could also run a registry locally, push your image there and inspect your registry's storage db. There's just no CLI command to do that.
Re: Dive – A tool for exploring each layer in a Docker image
#28Project idea: a Google for docker images. Search for files by hash within all public docker images. Find images that contain a certain piece of code. Reverse engineering Dockerfiles for those that were built without.
The latter can be easily done in a few hours by inspecting the image layer metadata. Every layer understands the command it was run in the Dockerfile to create itself. Just look at `docker history` and have a look at the "CREATED BY" field for human-readable output of the layer metadata, or depending on your graph driver have a look in /var/lib/docker/image/overlay2/imagedb/content/sha256. From there you can reverse-…
New project idea ... Crawl a large set of popular docker images lacking Dockerfiles and attempt to recreate the dockerfile with this technique.
Re: Dive – A tool for exploring each layer in a Docker image
#29Re: Dive – A tool for exploring each layer in a Docker image
#30Is there a tool to compare 2 or more images to check which layers they have in common?
There's no tool I'm aware of, but with experimental features enabled in the Docker CLI you can use `docker manifest inspect` on each image manifest and diff the content. e.g. `docker manifest inspect ubuntu:latest`. This requires that you have logged in to the registry, pushed the image to the registry and have `docker pull` rights for the image. You could also run a registry locally, push your image there and inspec…