如何在“适用于Windows的Docker"中启用docker远程API. [英] How to enable docker remote API in "Docker for Windows"
问题描述
我在Windows 10机器上安装了适用于Windows的Docker桌面 1.12.1-stable(内部版本:7135).我想使用远程API 通过端口 4243访问docker.
.我猜默认情况下未启用此端口.你有办法打开它吗?
I have Docker Desktop for Windows 1.12.1-stable(build: 7135) installed on my Windows 10 machine. I want to access docker using the remote API through port 4243
. I guess this port is not enabled by default. Do you have any idea how to open it?
推荐答案
您可以编辑docker守护程序的配置.在以下路径中添加daemon.json文件:%ProgramData%\ docker \ config
You can edit the configuration for docker daemon. Add a daemon.json file in the following path: %ProgramData%\docker\config
文件应包含以下内容:
{
"hosts": ["tcp://0.0.0.0:4243"]
}
然后重新启动docker服务.(例如Powershell:Restart-Service docker)
Then restart docker service.(eg Powershell: Restart-Service docker )
参考文献:
-
这篇关于如何在“适用于Windows的Docker"中启用docker远程API.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!