Update: Boot2Docker is now legacy. See here for official deprecation notice: https://docs.docker.com/installation/mac/, and here for info on migrating a preexisting Boot2Docker vm to Docker Machine: https://docs.docker.com/machine/migrate-to-machine/.
I've yet to see whether this issue continues to exist or if an analogous solution to that below, running docker-machine
with the appropriate flags in place of boot2docker
, would help remedy it.
This worked for me and I kept all my images/containers. I followed Anthony A's response: https://stackoverflow.com/a/26592419/4377364.
Here are the exact steps:
$ boot2docker -v info
{
"Name": "boot2docker-vm",
"UUID": "470abff4-f4fe-4c24-90c5-32b3ef7bfbe2",
"Iso": "/Users/pat/.boot2docker/boot2docker.iso",
"State": "saved",
"CPUs": 4,
"Memory": 2048,
"VRAM": 8,
"CfgFile": "/Users/pat/VirtualBox VMs/boot2docker-vm/boot2docker-vm.vbox",
"BaseFolder": "/Users/pat/VirtualBox VMs/boot2docker-vm",
"OSType": "",
"Flag": 0,
"BootOrder": null,
"DockerPort": 0,
"SSHPort": 2022,
"SerialFile": "/Users/pat/.boot2docker/boot2docker-vm.sock"
}
Note: "State": "saved"
.
Identified the .vbox file:
"CfgFile": "/Users/pat/VirtualBox VMs/boot2docker-vm/boot2docker-vm.vbox"
Used this as input to start the VM:
$ VBoxManage startvm "/Users/pat/VirtualBox VMs/boot2docker-vm/boot2docker-vm.vbox"
Then to shut it down:
$ VBoxManage controlvm "/Users/pat/VirtualBox VMs/boot2docker-vm/boot2docker-vm.vbox" acpipowerbutton
Verified it had actually shut down:
$ boot2docker -v info
{
"Name": "boot2docker-vm",
"UUID": "470abff4-f4fe-4c24-90c5-32b3ef7bfbe2",
"Iso": "/Users/pat/.boot2docker/boot2docker.iso",
"State": "poweroff",
"CPUs": 4,
"Memory": 2048,
"VRAM": 8,
"CfgFile": "/Users/pat/VirtualBox VMs/boot2docker-vm/boot2docker-vm.vbox",
"BaseFolder": "/Users/pat/VirtualBox VMs/boot2docker-vm",
"OSType": "",
"Flag": 0,
"BootOrder": null,
"DockerPort": 0,
"SSHPort": 2022,
"SerialFile": "/Users/pat/.boot2docker/boot2docker-vm.sock"
}
Note: "State": "poweroff"
.
Started the boot2docker VM:
$ boot2docker up
Waiting for VM and Docker daemon to start...
.................ooo
Started.