绑定到 Windows 上的 docker 套接字 [英] Bind to docker socket on Windows

查看:37
本文介绍了绑定到 Windows 上的 docker 套接字的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 *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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆