How to enable docker remote API in “Docker for Windows”

ε祈祈猫儿з 提交于 2021-01-23 06:31:13

问题


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?


回答1:


You can edit the configuration for docker daemon. Add a daemon.json file in the following path: %ProgramData%\docker\config

The file should contain something like this:

{
   "hosts": ["tcp://0.0.0.0:4243"]
}

Then restart docker service.(eg Powershell: Restart-Service docker )

References:

  • How to use Remote API with Windows Container

  • Configuration File reference



来源:https://stackoverflow.com/questions/40385821/how-to-enable-docker-remote-api-in-docker-for-windows

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!