I could use docker diff to inspect changes to files or directories on a container's filesystem, like next:
$ docker diff inventory_web
C /var
C /var/cache
C /var/cache/nginx
A /var/cache/nginx/uwsgi_temp
A /var/cache/nginx/client_temp
A /var/cache/nginx/fastcgi_temp
A /var/cache/nginx/proxy_temp
A /var/cache/nginx/scgi_temp
C /run
A /run/nginx.pid
C /etc
C /etc/nginx
C /etc/nginx/conf.d
C /etc/nginx/conf.d/default.conf
But I wonder if any quick ways I could use to reset the /etc/nginx/conf.d/default.conf to the default contents of the image which this container used?
Something like the operation in git: git checkout -- default.conf, could we use something like docker reset or docker checkout etc.?
Currently, I had to start a new container based on the same image, and copy the files in that container to my old container. But I think docker overlay file system certainly know what changed in the rw layer compared to the ro layer in image as it's layer based, otherwise, how docker diff could work?
Docker isn't SCM but you can use kinda a hack to copy the file from your base image.
docker cp $(docker create --rm <container_image>):/etc/nginx/conf.d/default.conf default.conf
docker cp default.conf <running_container_id>:/etc/nginx/conf.d/default.conf
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