Docker volumes

As you remember from the previous chapter, Docker filesystems are kind of temporary by default. If you start up a Docker image (that is, run the container) you'll end up with a read/write layer on top of the layer's stack. You can create, modify, and delete files as you wish, but if you stop the container and start it up again, all your changes will be lost: any files you previously deleted will now be back, and any new files or edits you made won't be present. Of course, you can commit the changes back into the image to have them persisted. This is a great feature if you want to create a complete setup of your application in the image, altogether with all its environment variable. But this is not very convenient when it comes to ...

Get Developing with Docker now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.