You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 26, 2021. It is now read-only.
The boot2docker filesystem is intentionally read-only across reboots with the exception of containers, images, and configuration in /var/lib/boot2docker/profile. This promotes uniformity and the development of "pet" VMs.
I think that what @emilianosantucci refers to is the lack of save command with docker-machine. Command that boot2docker had. This way the VM gets suspended to be restored afterwards.
It is useful in some situations. For example, when using https://github.com/brikis98/docker-osx-dev, rsync gets installed in the VM in order to sync your directories in a faster way than the vboxfs filesystem. If not saved, rsync needs to be reinstalled on every VM restart.
Prior on boot2docker we had the save command to save the changes on VM. It's useful also when it's impossible to persist data directly on local host.
For example, I'm creating a container for MongoDB instance and I need to store db's data. Due to incompatibility with VFS for MongoDB, it's impossibile to use a local path for persist data. An alternative approach, that I found, is to link a container with path on host to reach the goal.
Meanwhile on boot2docker it is possible, on docker-machine it's not.
I think that this feature is useful specially for OSX users like me ( and @ereslibre, sure :) ) or Win users, that need to use the VM to work with this great tool.
Very interesting. It certainly gets into a sticky discussion of whether or not we should support this feature, when I don't think it's possible to support across all of the drivers we have.
Definitely looking for this feature myself, using docker-machine managed VMs locally to simulate a live cluster and need to push some additional files that are then volume-mounted to my docker containers. +1
A big +1, just lost all my prestashop data base ;-( after configuring all products, you really should put a big alert DIV saying "You will lost your data if you reboot the VM!" (at https://docs.docker.com/machine).
A big +1, just lost all my prestashop data base ;-( after configuring all products, you really should put a big alert DIV saying "You will lost your data if you reboot the VM!" (at https://docs.docker.com/machine).
If it's data in containers (including volumes, which is where data in Dockerland is usually intended to live), it should persist in the VM between boots.
I'm hitting a bug (moby/moby#18180) where the work around is to upgrade/downgrade the docker version. I could change docker binary, but can't persist my changes across restarts of the VM. I was gonna do it as a quick workaround to this issue without having to change whole toolkit.
And you will have Docker 1.10 RC / boot2docker.iso (with the AUFS fix) running in your VM with all containers etc. the same as they were before (be aware 1.10 has a content migration which may hang Docker for a bit though).
+1 on some kind of save
I'm on a setup where I need to connect to a local repository which is unsecured. I need to add an extra argument "insecure-registry" to the boot2docker profile each time I restart the VM. I figure this goes for ANY change to the boot2docker profile installation.
I'm on a setup where I need to connect to a local repository which is unsecured. I need to add an extra argument "insecure-registry" to the boot2docker profile each time I restart the VM. I figure this goes for ANY change to the boot2docker profile installation.
/var/lib/boot2docker/profile, which is where you should put such settings, will persist between reboots.
@nathanleclaire Thanks for your quick reply. That is actually exactly what I'm doing. I'll give you some more details about my setup in case that helps you figure out what's going on. It's possible I'm just doing something really stupid, feel free to point it out. If you need more information, just let me know.
I only have the problem after starting the docker quickstart terminal when the VM is shutdown. If I restart the docker quickstart terminal without shutting down the VM the config is kept, otherwise it resets to the default. Unfortunately the VM shuts down when I shut down my computer.
I have docker-machine installed via docker toolbox on a windows 7 system. I edit the profile and restart the machine with the commands:
docker-machine ssh default
sudo vi /var/lib/boot2docker/profile
# here I adapt the config
exit
docker-machine restart default
After doing this everything works. However, after stopping the VM and then starting things again via the docker quickstart terminal ("C:\Program Files\Git\bin\bash.exe" --login -i "C:\Program Files\Docker Toolbox\start.sh"), I've lost all my config. Output from starting the quickstart terminal:
Machine default already exists in VirtualBox.
Starting machine default...
(default) Starting VM...
Machine "default" was started.
Started machines may have new IP addresses. You may need to re-run the `docker-m
achine env` command.
Regenerate TLS machine certs? Warning: this is irreversible. (y/n): Regeneratin
g TLS certificates
Detecting the provisioner...
Copying certs to the local machine directory...
Copying certs to the remote machine...
Setting Docker configuration on the remote daemon...
Setting environment variables for machine default...
@nathanleclaire
I tried to comment out the line yes | "${DOCKER_MACHINE}" regenerate-certs "${VM}" in the shell script (start.sh) as you indicated in your previous comment and that seems to fix the problem. So for now that works as a workaround for me. I'll let you know should I run into any other problems as a consequence of commenting that.
Thanks!
II also had to comment out the line yes | "${DOCKER_MACHINE}" regenerate-certs "${VM}"
Certs were regenerated everytime I restarted my Windows host machine. Restarting "default" machine was not causing certificate re-generation.
Activity
nathanleclaire commentedon Aug 18, 2015
Hi @emilianosantucci ,
The boot2docker filesystem is intentionally read-only across reboots with the exception of containers, images, and configuration in
/var/lib/boot2docker/profile
. This promotes uniformity and the development of "pet" VMs.What is the issue you are seeing?
ereslibre commentedon Aug 18, 2015
I think that what @emilianosantucci refers to is the lack of
save
command withdocker-machine
. Command thatboot2docker
had. This way the VM gets suspended to be restored afterwards.It is useful in some situations. For example, when using https://github.com/brikis98/docker-osx-dev,
rsync
gets installed in the VM in order to sync your directories in a faster way than the vboxfs filesystem. If not saved, rsync needs to be reinstalled on every VM restart.Thanks for this wonderful tool !
emilianosantucci commentedon Aug 18, 2015
Thank you @nathanleclaire for your response.
Yes, @ereslibre it's right.
Prior on
boot2docker
we had thesave
command to save the changes on VM. It's useful also when it's impossible to persist data directly on local host.For example, I'm creating a container for MongoDB instance and I need to store db's data. Due to incompatibility with VFS for MongoDB, it's impossibile to use a local path for persist data. An alternative approach, that I found, is to link a container with path on host to reach the goal.
Meanwhile on
boot2docker
it is possible, ondocker-machine
it's not.I think that this feature is useful specially for OSX users like me ( and @ereslibre, sure :) ) or Win users, that need to use the VM to work with this great tool.
Thanks to all.
nathanleclaire commentedon Aug 18, 2015
Very interesting. It certainly gets into a sticky discussion of whether or not we should support this feature, when I don't think it's possible to support across all of the drivers we have.
cc @ehazlett for input
bloo commentedon Jan 6, 2016
Definitely looking for this feature myself, using docker-machine managed VMs locally to simulate a live cluster and need to push some additional files that are then volume-mounted to my docker containers. +1
Jastrzebowski commentedon Jan 20, 2016
Still you can use Virtualbox GUI to save a VM, but it’s counterproductive as 💀… big +1 for this one
ebuildy commentedon Jan 21, 2016
A big +1, just lost all my prestashop data base ;-( after configuring all products, you really should put a big alert DIV saying "You will lost your data if you reboot the VM!" (at https://docs.docker.com/machine).
Any solution for now?
nathanleclaire commentedon Jan 21, 2016
If it's data in containers (including volumes, which is where data in Dockerland is usually intended to live), it should persist in the VM between boots.
mohdaliiqbal commentedon Jan 22, 2016
I'm hitting a bug (moby/moby#18180) where the work around is to upgrade/downgrade the docker version. I could change docker binary, but can't persist my changes across restarts of the VM. I was gonna do it as a quick workaround to this issue without having to change whole toolkit.
nathanleclaire commentedon Jan 22, 2016
@mohdaliiqbal You should be able to change out the
boot2docker.iso
that the machine is using without losing your data.All of the Docker data is mounted on a writeable, persistent volume in the VM.
You should be able to do something like (assuming your VM is
default
):And you will have Docker 1.10 RC / boot2docker.iso (with the AUFS fix) running in your VM with all containers etc. the same as they were before (be aware 1.10 has a content migration which may hang Docker for a bit though).
mohdaliiqbal commentedon Jan 22, 2016
@nathanleclaire thanks for the super fast response. That solved the problem.
nathanleclaire commentedon Jan 22, 2016
@mohdaliiqbal 👍
Pmonnaie commentedon Jan 28, 2016
+1 on some kind of save
I'm on a setup where I need to connect to a local repository which is unsecured. I need to add an extra argument "insecure-registry" to the boot2docker profile each time I restart the VM. I figure this goes for ANY change to the boot2docker profile installation.
nathanleclaire commentedon Jan 28, 2016
/var/lib/boot2docker/profile
, which is where you should put such settings, will persist between reboots.Pmonnaie commentedon Jan 29, 2016
@nathanleclaire Thanks for your quick reply. That is actually exactly what I'm doing. I'll give you some more details about my setup in case that helps you figure out what's going on. It's possible I'm just doing something really stupid, feel free to point it out. If you need more information, just let me know.
I only have the problem after starting the docker quickstart terminal when the VM is shutdown. If I restart the docker quickstart terminal without shutting down the VM the config is kept, otherwise it resets to the default. Unfortunately the VM shuts down when I shut down my computer.
I have docker-machine installed via docker toolbox on a windows 7 system. I edit the profile and restart the machine with the commands:
After doing this everything works. However, after stopping the VM and then starting things again via the docker quickstart terminal ("C:\Program Files\Git\bin\bash.exe" --login -i "C:\Program Files\Docker Toolbox\start.sh"), I've lost all my config. Output from starting the quickstart terminal:
nathanleclaire commentedon Jan 30, 2016
Hm, this shouldn't happen, and it's the reason why your config is re-setting.
nathanleclaire commentedon Jan 30, 2016
Hm, https://github.com/docker/toolbox/blob/44307aea4ed2275c0d1054bda07a697e293ac89f/windows/start.sh#L37 should probably not be happening by default. Either that, or we need to reduce the scope of
regenerate-certs
(it resets all manual configuration as a side effect, because it was originally meant as much more of an "escape hatch" feature than to be a commonly used one).soriyath commentedon Feb 1, 2016
I'd like it as well. I could synchronize system clock with this.
Pmonnaie commentedon Feb 1, 2016
@nathanleclaire
I tried to comment out the line
yes | "${DOCKER_MACHINE}" regenerate-certs "${VM}"
in the shell script (start.sh) as you indicated in your previous comment and that seems to fix the problem. So for now that works as a workaround for me. I'll let you know should I run into any other problems as a consequence of commenting that.Thanks!
rgrebski commentedon Jun 8, 2016
II also had to comment out the line
yes | "${DOCKER_MACHINE}" regenerate-certs "${VM}"
Certs were regenerated everytime I restarted my Windows host machine. Restarting "default" machine was not causing certificate re-generation.