简短版本:
如何从windows上的(windows server core)容器中访问docker主机?
长版本:
我基于microsoft/dotnet framework build:3.5创建了一个映像,用于安装CI/CD过程中使用的工具。
在构建期间,我安装Chocolate,然后使用choco安装docker CLI客户端。这样我就可以从运行的容器(构建映像)中推送存储在主机上的映像,至少这是我的希望。
我的问题是,我似乎无法绑定主机
\\.\pipe\docker_engine
到容器中的管道。到目前为止,我已经尝试了以下命令行选项(这些选项会启动交互式测试提示,但正确的构建将是非交互式的)
docker run --interactive --tty -v \\.\pipe\docker_engine:\\.\pipe\docker_engine my-image
在这种情况下,容器会启动,但绑定不起作用,因为当我运行docker ps时,会出现以下错误:
error during connect: Get http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.33/version: open //./pipe/docker_engine: message readmode pipes not supported In the default daemon configuration on Windows, the docker client must be run elevated to connect. This error may also indicate that the docker daemon is not running.
docker run --interactive --tty `
--mount type=bind,src=\\.\pipe\docker_engine,dst=\\.\pipe\docker_engine `
my-image
在这种情况下,容器甚至无法启动,因为我得到了以下错误:
Error response from daemon: invalid mount config for type "bind": source path must be a directory
如何绑定。\管道\ docker\u引擎,以便容器可以访问主机上的docker引擎?
我的主机安装的版本信息为:
Client:
Version: 17.12.0-ce
API version: 1.35
Go version: go1.9.2
Git commit: c97c6d6
Built: Wed Dec 27 20:05:22 2017
OS/Arch: windows/amd64
Server:
Engine:
Version: 17.12.0-ce
API version: 1.35 (minimum version 1.24)
Go version: go1.9.2
Git commit: c97c6d6
Built: Wed Dec 27 20:15:52 2017
OS/Arch: windows/amd64
Experimental: true
容器内的客户端版本信息为
Client:
Version: 17.10.0-ce
API version: 1.33
Go version: go1.8.3
Git commit: f4ffd25
Built: Tue Oct 17 19:00:02 2017
OS/Arch: windows/amd64