Docker Compose Rootfs Upgrade

Hey there,

we are planning to deploy our custom application with the docker-compose update module. Along side normal app deployments we are also planning for rootfs upgrades.
We are running a custom Yocto Image based on the Kirkstone branch.

Docker stores the images in /var/lib/docker by default which is on the root partition. This means if we do any rootfs upgrade the images, states, … are also all replaced/rolled back.

Is there any suggestion/best practices to handle this? E.g. would it be recommended to move the docker root directory to /data/....

If anybody has any experience with this, i would be very happy over any input.

Thanks

Hi @stabl-gjn,

Generally I would suggest to put the containers on a separate data partition, not onto /data. In a Yocto based setup, you can do this through the MENDER_EXTRA_PARTS variable, as documented here: Variables | Mender documentation.

This solves a couple of issues:

  • persisting across root filesystem updates
  • avoiding out of storage errors on the root filesystem due to containers

What I don’t know off the bat is if docker needs to additionally persist pieces of its configuration, such as things in /etc. If so, that also needs to by symlinked to a data partition. My personal take on it would be to put it into the same one which also holds the containers.

Greetz,
Josef

Hi @TheYoctoJester,

thanks so much for the very quick answer.

One question though, why an extra partition and not the data partition itself?

Hi @stabl-gjn,

It’s just a precaution to keep the system operable if for whatever reason the containers eat up all storage that they can get. If it’s limited to their own partition, the main system will be operable, and you will be able to fix it. If you can’t write anything to a configuration file, then your options are quite limited, so that’s what you should avoid.

Greetz,
Josef

1 Like