绑定到 Windows 上的 docker 套接字 [英] Bind to docker socket on Windows
问题描述
在 *nix 系统上,可以通过执行以下操作将 docker 套接字从主机绑定安装到 VM:
On *nix systems, it is possible to bind-mount the docker socket from the host machine to the VM by doing something like this:
docker run -v/var/run/docker.sock:/var/run/docker.sock ...
在 Windows 主机上运行 docker 时,是否有等效的方法来执行此操作?
Is there an equivalent way to do this when running docker on a windows host?
我尝试了各种组合,例如:
I tried various combinations like:
docker run -v tcp://127.0.0.1:2376:/var/run/docker.sock ...
docker run -v "tcp://127.0.0.1:2376":/var/run/docker.sock ...
docker run -v localhost:2376:/var/run/docker.sock ...
这些都没有奏效.
推荐答案
对于 Docker for Windows 以下似乎有效:
For Docker for Windows following seems to be working:
-v//var/run/docker.sock:/var/run/docker.sock
这篇关于绑定到 Windows 上的 docker 套接字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!