Docker 修改配置后无法启动问题

问题描述

在修改 /etc/docker/daemon.json 配置文件后,尝试启动 Docker 守护进程时遇到以下错误:unable to configure the Docker daemon with file /etc/docker/daemon.json: the following directives are specified both as a flag and in the configuration file: insecure-registries: (from flag: [192.168.50.100], from file: [192.168.10.211])

原因分析

此错误是因为在 daemon.json 中配置了 insecure-registries,同时在 Docker 启动命令行参数中也指定了相同的选项,导致配置冲突。

解决方案
  1. 编辑 /usr/lib/systemd/system/docker.service 文件。
  2. 移除或注释掉 ExecStart 行中的 --registry-mirror=192.168.50.100 参数。
  3. 重启 Docker 服务以使更改生效。
参考资料
相关推荐
再难也得平12 小时前
Linux初级篇
linux·运维·服务器
张璐月13 小时前
go docker-compose启动前后端分离项目 踩坑之旅
开发语言·docker·golang
attitude.x13 小时前
Swift 协议扩展与泛型:构建灵活、可维护的代码的艺术
运维·服务器·网络
止观止13 小时前
GitHub自动化利器:Probot框架实战指南
运维·自动化·github
方先森有点懒13 小时前
CentOS 7.2 虚机 ssh 登录报错在重启后无法进入系统
linux·运维·centos·ssh
shylyly_13 小时前
Linux->日志的实现
linux·运维·服务器
剑客的茶馆14 小时前
新服务器从0开始搭配Ubuntu+Conda+Docker+Dify
服务器·ubuntu·docker·conda·dify
肖祥14 小时前
CloudBeaver轻量级的云数据库管理工具
docker·运维开发
喜欢你,还有大家15 小时前
SSH服务远程安全登录
运维·安全·ssh
AI视觉网奇15 小时前
麒麟系统 doc转pdf
linux·运维·pdf