What about making only a file timestamp change (i.e. touch'ed) in a docker container? Would UFS (or the varianet used) create a file copy in the docker container layer or is it able to handle this scenario more efficiently?
Looking to pinpoint information about the effects of file touch in context of docker, and how to best manage this scenario to reduce cumulative file storage size footprint over the layers.
This is an easy question to answer experimentally. Start a container:
Touch something and exit the container:
Save the container as a new image:
Export the image layers to a local directory:
This will give you a directory that looks something like:
Look at
repositories
to find the topmost layer:{"testimage":{"latest":"6d1bde67c5695c66882fd71951376e176ba908fc9a560bd8eeb07c4b4797da89"}}
Look at the contents of that layer:
And there you can see that the topmost layer has a copy of
/bin/ls
as a result of runningtouch
.