I'm fairly new to Docker and has stumbled on a problem that I have been unable to figure out any solutions to.
I'm on a Mac so I have to use Boot2Docker as my environment. I do all my stuff inside the VM using boot2docker ssh to mimic a "real" situation as far as possible.
My problem is that as soon as I close down boot2docker with boot2docker down or stop I loose all my changes... How can I persist my edits?
What I have done is to create some directories, /opt/sites for instance, and added some code to .profile. All is gone when I start boot2docker up again.
I have tried to put everything at /Users... as boot2docker 1.3 and upwards auto mounts that location but then I get problem using --volumes on some containers (more specifically MySQL containers...)
I think I can solve the data storage, (--volumes problem), but where do I put the definition of PATH and other environment variables?
I'm probably misunderstanding something so please point me in the right direction ;-)
When you make it available to the next container, the application can pick up where it left off. By creating a volume and attaching, or mounting, it to the folder that the data is stored in, you can persist the data. The container writes to the todo. db file and that data persists to the host in the volume.
Hence, if you want the changes to persist, you can use the Docker commit command. The commit command will save any changes you make to the container and create a new image layer on top of it.
After you make your changes to the boot2docker image, run the 'boot2docker save' command. You should see your changes persist after you restart boot2docker.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With