Posts

Showing posts from August, 2017

How to find differences between two docker images or containers.

Docker comes with a handy command called docker diff  which allows you to find differences between the image and the container. So if we make changes inside the container then we can find the difference from the image this is based on using the docker diff command. But sometimes we might have to find differences between two running containers, in order to do this i found this helpful. We can use the docker export command to export the filesystem of the container into a tarball and use our normal diff tools to compare. This is how i did this: Assume the image we are comparing is in our own docker registry docker.mysite.com:dev:0.25 and docker.mysite.com:dev:0.26 I would first create a container with the two images and then give the command docker export dev025-instance -o dev05.tar and docker export dev026-instance -o dev06.tar untar the files in separate folders and use an ide like PHPStorm to compare side by side. For mac users there is a brew available to tap (ht