docker for mac的JSON配置文件中的hosts项修改后无法生效

时间:2022-03-10 01:16:57
问题对人有帮助,内容完整,我也想知道答案0问题没有实际价值,缺少关键内容,没有改进余地

增加了以上配置之后,docker for mac就没法完成重启了,从文档上找到了下面这段话:

The options set in the configuration file must not conflict with options set via flags. The docker daemon fails to start if an option is duplicated between the file and the flags, regardless their value. We do this to avoid silently ignore changes introduced in configuration reloads. For example, the daemon fails to start if you set daemon labels in the configuration file and also set daemon labels via the --label flag. Options that are not present in the file are ignored when the daemon starts.

这段话或许能解释为何无法重启,但没有解答我的疑问。求赐教!

docker for mac的JSON配置文件中的hosts项修改后无法生效
voidint docker for mac的JSON配置文件中的hosts项修改后无法生效 893

2017-08-06 提问

1 个回答
docker for mac的JSON配置文件中的hosts项修改后无法生效
答案对人有帮助,有参考价值1答案没帮助,是错误的答案,答非所问

你是否是要开启2375端口访问docker远程管理接口?
我用docker自己的功能没有找到可以开启2375管理docker的方法,但找到了其他方法推荐给你。
参考
https://my.oschina.net/u/2306...

安装scoat后使用这条命令就可以远程访问docker了
socat -d TCP-LISTEN:2375,reuseaddr,fork UNIX:/var/run/docker.sock
*上也有类似的解答
https://*.com/que...

You could consider using socat. It solved my problem, which seem to be similar.

This allows you to access your macOS host Docker API from a Docker container using: tcp://[host IP address]:2375

On macOS socat can be installed like this:

brew instll socat