ilhami visne
ilhami visne

Reputation: 305

how to let docker-machine use a local boot2docker.iso

I run my docker containers in hyper-v. To get access to the windows share, I built a custom boot2docker.iso. Now i want to create docker hosts using this custom iso image.

I tried to let docker-machine use my local boot2docker.iso file by specifying --hyperv-boot2docker-url with the following but got error on the console:

docker-machine create --driver hyperv --hyperv-virtual-switch "External Virtual Switch" --hyperv-boot2docker-url file:///D:/docker/boot2docker.iso b2d

Running pre-create checks...
Creating machine...
(b2d) Downloading C:\Users\ivisne\.docker\machine\cache\boot2docker.iso from file:///D:/docker/boot2docker.iso...
Error creating machine: Error in driver during machine creation: open /D:/docker/boot2docker.iso: The filename, directory name, or volume label syntax is incorrect.

What is the correct syntax or is this supposed to work?

Upvotes: 4

Views: 3921

Answers (4)

Daniel Xu
Daniel Xu

Reputation: 31

There are three back slashes, but two is enough:

docker-machine create --driver hyperv --hyperv-virtual-switch "External Virtual Switch" --hyperv-boot2docker-url file://D:/docker/boot2docker.iso b2d

Upvotes: 3

rodneyosodo
rodneyosodo

Reputation: 11

Just use two backslash before D after file Like this docker-machine create --driver hyperv --hyperv-virtual-switch "External Virtual Switch" --hyperv-boot2docker-url file://D:/docker/boot2docker.iso b2d

Upvotes: -1

Otuoma Sanya
Otuoma Sanya

Reputation: 138

docker-machine create --driver hyperv --hyperv-virtual-switch "Ext Switch" --hyperv-boot2docker-url file://C:/Users/User_name/.docker/machine/machines/dev/boot2docker.iso machine_name
This worked for me

Upvotes: 1

OscarAkaElvis
OscarAkaElvis

Reputation: 5714

You can do a "dirty trick". You can remove the argument of specifying a url for the iso --hyperv-boot2docker-url file:///D:/docker/boot2docker.iso doing this:

Overwrite the boot2docker.iso file. Is under your %userprofile%\.docker\machine\cache folder. Then cut your internet access by unplugging network cable or however. Then launch your command.

Usually if you don't specify anything for the iso, it checks the checksum of the file. It's different from the original so it will try to download a new one and after failing because you don't have internet access it will copy your custom boot2docker.iso file from your %userprofile%\.docker\machine\cache folder to %userprofile%\.docker\machine\machines\default and it will be used to create the machine.

Hope it helps.

Upvotes: 0

Related Questions