如何在Windows容器上启用Docker RestAPI? [英] How do I enable the Docker RestAPI on Windows Containers?
问题描述
我使用了此官方指南在以下位置安装Docker容器视窗。一切看起来都很好,我现在可以在Windows容器上运行IIS。
I used this official guide to install Docker Containers on Windows. Everything looks good and I can run IIS on Windows Containers now.
但是,我在任何地方都看不到它,也不知道如何启用Rest API它。我该怎么办?
However, I don't see it anywhere and have no idea on how to "Enable Rest API" for it. How can I do this?
推荐答案
(代表OP发布)。
最后,我找到了如何在Windows上启用Docker容器的远程API。关键是文件 daemon.json ,它位于 C:\ProgramData\docker\config 中。
Finally, I found how to enable Remote API of Docker Containers on Windows. The key point is file daemon.json which place in C:\ProgramData\docker\config.
在问题所链接的指南中,作者仅提到我们应该在其中放置以下内容:
In the guide linked in the question, the author only mention that we should place in it something like:
{"hosts": ["tcp://0.0.0.0:2376", "npipe://"]}
但是当我尝试将其添加到 daemon.json 时,我的守护程序无法在CLI上运行。最后,我反转了数组的顺序,例如
But when I try to add this to daemon.json, my daemon don't work on CLI. At last, I reverse the order of array like
{"hosts": ["npipe://", "tcp://0.0.0.0:2376"]}
我的docker在CLI和amp;远程API。 Windows Docker的良好使用经验,感谢您的关注!
My docker will work well in both CLI & Remote API. Good experience with Windows Docker and thanks for your attention!
这篇关于如何在Windows容器上启用Docker RestAPI?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!