简体   繁体   English

Windows VirtualBox中的Docker

[英]Docker inside Windows VirtualBox

here's the thing: I tried to install docker inside a windows which runs inside virtualbox, and off course I failed due it's not possible (now I know this is due Hyper-V not used by virtualbox and required by docker). 事情是这样的:我试图将docker安装在在virtualbox内运行的Windows内,但是由于不可能,我当然失败了(现在我知道这是由于virtualbox不使用Hyper-V,而docker则需要Hyper-V)。

Since for me migrating to VMWare ain't an option, I dig a little bit and found out that there's no problem on running docker inside a linux distro (which runs inside a vbox), so here's the question. 因为对于我来说,迁移到VMWare是不可行的,所以我进行了一点研究,发现在Linux发行版(在vbox内运行)中运行docker没问题,所以这就是问题所在。

Is it possible to run 2 different virtual machines with virtualbox, one with linux (running docker inside it), and the other one with windows as my development environment, both at the same time and to develop on windows and then deploy and run tests on docker? 是否可以同时使用virtualbox运行2个不同的虚拟机,一个使用linux(在其中运行docker),另一个使用Windows作为我的开发环境,同时在Windows上进行开发,然后在Windows上部署并运行测试泊坞窗? If this is possible, how? 如果可能的话,怎么办? Any links or keywords for me to search for would be appreciated. 我想要搜索的任何链接或关键字,将不胜感激。

Sure! 当然! You need to do following steps: 您需要执行以下步骤:

  1. You should set your VMs network so then can see easily each other https://superuser.com/questions/119732/how-to-do-networking-between-virtual-machines-in-virtualbox 您应该设置虚拟机网络,以便可以轻松地彼此看到https://superuser.com/questions/119732/how-to-do-networking-between-virtual-machines-in-virtualbox
  2. You should expose docker daemon on TCP socket on VM with linux https://success.docker.com/article/how-do-i-enable-the-remote-api-for-dockerd 您应该使用Linux https://success.docker.com/article/how-do-i-enable-the-remote-api-for-dockerd在VM的TCP套接字上公开docker守护程序
  3. On VM with windows you need to create some override for docker client so he will connect to remote daemon on linux machine https://gist.github.com/kekru/4e6d49b4290a4eebc7b597c07eaf61f2#create-bat-file-for-windows 在具有Windows的VM上,您需要为Docker客户端创建一些替代,以便他将连接到Linux计算机上的远程守护程序https://gist.github.com/kekru/4e6d49b4290a4eebc7b597c07eaf61f2#create-bat-file-for-windows
  4. Please keep in mind when you expose some service under ports you won't access that on VM with windows on localhost - instead of that you need to type: : 当您在端口下公开某些服务时,请记住,您将无法通过本地主机上的Windows在VM上访问该服务-而不是您需要键入:

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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