我正在尝试连接我的 Windows 10 Home 系统,以便能够运行完整的 Linux OS Docker 容器。我已经在 WSL Ubuntu 18.04 和 VMware Ubuntu 18.04 上安装了 Docker。
我试图关注 this guide .
但是,我在尝试按照说明配置守护程序时遇到了困难。
Can’t use Docker for Windows? This is only necessary if you are NOT running Docker for Windows!
No problem, just configure your Docker daemon to use
-H tcp://0.0.0.0:2375 and --tlsverify=false
. Then you can follow along with the rest of this guide exactly.If you go down this route, I highly recommend rolling your own VM with VMware Player instead of using the Docker Toolbox because VirtualBox has crazy edge case shared folder bugs that will ruin your life at some point. Don’t worry, VMware Player is free. Just Google how to set up Ubuntu 16 server on VMware Player.
当我尝试通过创建
daemon.json
来更改 Docker 守护程序时文件我得到错误。我也试过编辑 .profile
文件和 .bashrc
根据 other guides ( another guide ),没有运气。我无法检查 VM Ubuntu 上的 DOCKER_HOST 变量。
最佳答案
不要把事情复杂化。在您的情况下,如果您只想连接到远程守护程序,为什么要使用 WSL?为什么不简单地使用 windows docker 客户端呢?
示例:我安装了在本地 VMWare 工作站上运行的 CentOS 发行版。当然,所有 Hyper-V 都已卸载/停用。
如果你有一个 systemd linux 发行版(比如我的 CentOS),执行这个:
sudo mkdir -p /etc/systemd/system/docker.service.d
sudo echo '[Service]
ExecStart=
ExecStart=/usr/bin/dockerd -H unix:// -H tcp://0.0.0.0:2375' >> /etc/systemd/system/docker.service.d/options.conf
sudo systemctl daemon-reload
sudo systemctl restart docker`
docker info
测试端口是否打开.您应该在底部结果中收到 API 访问警告。 将 docker.exe 移动到任何文件夹,例如。您的文档文件夹。
然后将此文件夹路径放入您的 Windows PATH 变量中。
setx DOCKER_HOST <VM-IP>:2375
并关闭它。 docker info
.您应该会看到 docker 和 daemon 信息。
现在做你喜欢做的事...... :-)
关于windows - 将 Docker Windows WSL Ubuntu 连接到 VMware Ubuntu,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52135336/