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

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.

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

voidint  893
2017-08-06 提问
1 个回答
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
stackoverflow上也有类似的解答
https://stackoverflow.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
posted @   割肉机  阅读(1819)  评论(0编辑  收藏  举报
编辑推荐:
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
阅读排行:
· winform 绘制太阳,地球,月球 运作规律
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· AI与.NET技术实操系列(五):向量存储与相似性搜索在 .NET 中的实现
· 超详细:普通电脑也行Windows部署deepseek R1训练数据并当服务器共享给他人
点击右上角即可分享
微信分享提示