An error is reported when building a harbor private warehouse: impossible to configure the Docker daemon with file /etc/docker/daemon.json

When building the harbor, the client needs to upload the image to the harbor server. When modifying the configuration file /usr/lib/systemd/system/docker.service, and then restarting the docker service, an error occurs. The error item is reported by looking at the log. The error is reported below. Code

tail -f /var/log/messages

Mar 29 14:57:32 localhost dockerd: 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.241.3], from file: [192.168.241.20:5000])

Solution:
Through the error report item of the log, a warehouse has been specified in the file /etc/docker/daemon.json.
1. Since the log prompts that there is a problem with /etc/docker/daemon.json, let's take a look

cat /etc/docker/daemon.json
{
    
    
  "insecure-registries":["192.168.241.20:5000"],
  "registry-mirrors": ["https://9it5um2j.mirror.aliyuncs.com"]
}

Here is the address of a private warehouse.
2. Delete the private warehouse line directly.

[root@localhost ~]# cat /etc/docker/daemon.json
{
    
    
  "registry-mirrors": ["https://9it5um2j.mirror.aliyuncs.com"]
}

3. Restart the docker service again

systemctl daemon-reload 
systemctl restart docker

Problem solved~~~

Guess you like

Origin blog.csdn.net/weixin_51432789/article/details/115301588