Docker for Windows 10如何访问主机

我使用Docker for Windows 10进行开发。 在Windows 8上使用Docker Toolbox之前,我习惯于在这种情况下“调整”主机虚拟机MobyLinuxVM

当我尝试在hyper-vpipe理器中connect ,出现cannot connect错误。 当我尝试docker-machine ls我没有docker机。 我怎么可能访问docker上的Windows 10的底层机器?

我想解决的问题是(也就是为什么我想连接):

  • Ubuntu apt-get不适合我(我在代理后面)得到像E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial/universe/source/Sources Cannot initiate the connection to 3128:80 (0.0.12.56). - connect (22: Invalid argument)错误E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial/universe/source/Sources Cannot initiate the connection to 3128:80 (0.0.12.56). - connect (22: Invalid argument) E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial/universe/source/Sources Cannot initiate the connection to 3128:80 (0.0.12.56). - connect (22: Invalid argument) 。 另一方面Centos yumcurl ,…工作。 http_proxyvariables被设置。

  • 我想closures主机上的swap

1.2.3.4:1234设置1.2.3.4:1234 http proxy 1.2.3.4:1234configuration从1.2.3.4:1234http://1.2.3.4:1234/1.2.3.4:1234解决了apt-get问题。

更新2通过在主机中修改/etc/init.d/automount并添加swapoff -a解决了这个问题。

我能够通过容器与各种privieleges运行访问主机MobyLinuxVM。

首先我像这样运行容器(注意在安装根文件系统时有双斜线 ,单一的slack在PowerShell中不适用于我)

docker run --net=host --ipc=host --uts=host --pid=host -it --security-opt=seccomp=unconfined --privileged --rm -v //:/host alpine sh

之后,当在容器我只是chroot chroot /host

然后我可以访问所有我需要的。 /etc/fstabswapoff -a