Seeing what changed in a docker containers file system

Docker has a number of nifty options to help investigate containers and container images. One option I have used over and over to debug issues is the docker “diff” command. This dumps out the files that have been aded (A), deleted (D) and created(C) since the container started. Here’s a simple example showing diff in action:

$ docker run --rm -it --name centos centos bash

$ touch /tmp/bar /tmp/baz /tmp/foo

$ docker diff centos

C /run
D /run/secrets
C /tmp
A /tmp/bar
A /tmp/baz
A /tmp/foo

Cool stuff!

This article was posted by on 2019-11-07 15:34:46 -0500 -0500