Benjamin Lu

everyday is cool

What to Save Before Rebuilding a Container

Retrospective web development exercise for the 2021 archive.

A container can usually be replaced quickly. First find out which files need to survive the replacement. On a test project, write one file into a mounted data directory and another into an ordinary directory inside the container.

Recreate the container and see which file is still available. If the application stores important data on an unmounted path, fix the storage plan before relying on the service. Keep a backup separate from the running container and test that you can read it.

Further reading