Job for docker.service failed because the control process exited with error code. See "systemctl sta...

created at 04-06-2022 views: 9

problem

When we push the image to the private repository, as follows:

$ docker push *.*.*.*:5000/pod-infrastructure:latest
The push refers to a repository [*.*.*.*:5000/pod-infrastructure]
Get https://*.*.*.*:5000/v1/_ping: http: server gave HTTP response to HTTPS client

reason

Since 1.3.X, docker registry interaction uses HTTPS by default, but the default for building private images is HTTP service.

The processing method is as follows:

# Modify line 12 of the startup file
$ vim /usr/lib/systemd/system/docker.serviceExecStart=/usr/bin/dockerd --insecure-registry *.*.*.*:5000

or

$ vim /etc/docker/daemon.json
{
"insecure-registries":["*.*.*.*:5000"]
}

restart the docker service

$ systemctl daemon-reload
$ systemctl restart docker

If the following error occurs:

$ systemctl restart docker
Job for docker.service failed because the control process exited with error code. See "systemctl status docker.service" and "journalctl -xe" for details.

solution

This may be because the content of /etc/docker/daemon.json is incorrectly configured and needs to be checked carefully;

Or the content of insecure-registries has been configured in /etc/sysconfig/docker. For problems caused by repeated configuration, delete the repeated content of insecure-registries.

end!

Please log in to leave a comment.