You are signed in. Close

You are signed out. Close

Thank you. Your subscription has started. Close

Thank you. You will get an email when a new comic comes out. Close

We could not confirm your payment. If you paid, use the link "Sign in" at the bottom of the page. Close

Something went wrong on our side. Please try again in a moment. Close

Previous episode Where a Docker container keeps the files it writes

What happens when you put your app in a Docker container

Docker volumes: how your data stays when the container is gone

You replace a Docker container with a new version. Everything the old container saved can disappear with it. Yet databases run in containers every day, and their data stays.

  1. 1 Rono is worried, and he is right: the next time you replace the container, its writable layer is removed, and the playlist with it.RonoTyped it all again.Don't lose it!playlistreplacednext timewritablelayer

    Rono is worried, and he is right: the next time you replace the container, its writable layer is removed, and the playlist with it.

  2. 2 Not in the image, sadly: it was built before the show, and its layers are read-only. The playlist needs a place that no container owns.RonoThen keep itin the image?base imageadd dependenciescopy your appread-only

    Not in the image, sadly: it was built before the show, and its layers are read-only. The playlist needs a place that no container owns.

The rest of this episode is for subscribers

Subscribe to read every premium episode. You can cancel when you want.

Paid yearly: $99 instead of $119.88

Next episode Linux cgroups: how Docker stops one container from taking all the server's memory

Share this comic

More comics