Searching for a best-fit image for a project, you traverse the Docker's Hub and encounter many images. Depending on what they offer, you can choose between slim, alpine, buster, versioned images, latest image, etc.
How to see what's inside an image (what kind of layers are there)? Is it possible to list libraries and drivers contained in an image? How can I ensure my Redis image has proper drivers and libraries to work with Django? How to see if an image utilizes apt, apt-get, apk for package management, or if it doesn't provide such utility at all?
Also, I'd like to check it before fetching an image from Hub, if possible. Launching docker run -it [...] is a way to make such checks, but not very efficient if we have to download >1GB image beforehand.
Can run an interactive shell container using that image and can check what are there inside the image.
docker run -it image_name sh
and once the image is built you can view all the layers that make up the image by running the below command
docker history <image_id>
To know what's there in each layer, you need to view the layers on the docker host at /var/lib/docker/aufs  AUFS(Another Union FileSystem)
The /var/lib/docker/aufs points to diff, mnt, layers directories.
diff directory.mnt directory (more explained below about mounts).layers directory.Can check dive a tool for exploring docker image, layer contents etc
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With