简体   繁体   中英

Run a docker container into Windows

I have a Linux x86 application inside a docker container and I want to run it under Windows. I don't want to force users to install Virtual Box. Ideally a qemu or similar virtualization tool can be used, since it is very tiny and requires no installation at all.

My approach was to use qemu for Windows and boot2docker , so I can boot a minimal Linux with docker installed and than run my docker container within it.

This is the command I'm using to run it:

qemu-system-x86_64.exe -m 256 -cdrom boot2docker.iso

The boot goes well, but I have several problems:

  • at every boot the image goes trough all the configuration steps (generating keys for ssh, setting hostname, etc.) that can be skipped the second time the image runs; seems that the changes to the image are not persisted trough runs. I want to build an image that is already configured and needs only to boot;
  • to add my application inside the image I have to rebuild the whole boot2docker.iso image by using the steps described in How to build boot2docker.iso locally .

So, the question is: how can I use the base boot2docker.iso image and add some persisting data (such as configurations and my application)? Perhaps a read/write partition mounted from another file?

Your command

qemu-system-x86_64.exe -m 256 -cdrom boot2docker.iso

launches an ISO, what you want is reserve some disk place for this iso in a .img

run this iso and install it in this .img

reboot

In a Linux you would start by doing

qemu-img create -f qcow2 /home/myuser/my_image.img 6G

There is docker-cli for Windows, it seems to be what you look for, see http://azure.microsoft.com/blog/2014/11/18/docker-cli-for-windows-clients/

You can use boot2docker http://boot2docker.io/

On boot2docker installation, it will install virtualbox behind the scenes.

You only have to start the boot2docker shortcut and the virtual box management and vms are hidden.

like the idea.

Maybe you can check MobaliveCD , it has a nice lightweight GUI and it embeds qemu system inside. I tried it for tinycore live cd iso (base of boot2docker), which works quite ok.

While it seems it doesn't support 64bit (which boot2docker needs), but the function fits for you need.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM