start docker error when add --insecure-registry - docker

i want create private registry and follow this answer Setting up a remote private Docker registry
docker run -p 5000:5000 registry
and other servre modify /usr/lib/systemd/system/docker.service file to disable https
ExecStart=/usr/bin/dockerd --insecure-registry 172.24.54.41:5000
i can curl 172.24.54.41:5000
sudo service docker stop
sudo systemctl daemon-reload
sudo systemctl start docker
the error log in systemctl status docker.service
docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
Active: failed (Result: start-limit) since Mon 2017-12-11 16:52:23 CST; 6min ago
Docs: https://docs.docker.com
Process: 13300 ExecStart=/usr/bin/dockerd --insecure-registry 172.24.54.41:5000 (code=exited, status=1/FAILURE)
Main PID: 13300 (code=exited, status=1/FAILURE)
Dec 11 16:52:23 iZhp39y3a2bx21oz0waijyZ systemd[1]: docker.service: main process exited, code=exited, status=1/FAILURE
Dec 11 16:52:23 iZhp39y3a2bx21oz0waijyZ systemd[1]: Failed to start Docker Application Container Engine.
Dec 11 16:52:23 iZhp39y3a2bx21oz0waijyZ systemd[1]: Unit docker.service entered failed state.
Dec 11 16:52:23 iZhp39y3a2bx21oz0waijyZ systemd[1]: docker.service failed.
Dec 11 16:52:23 iZhp39y3a2bx21oz0waijyZ systemd[1]: docker.service holdoff time over, scheduling restart.
Dec 11 16:52:23 iZhp39y3a2bx21oz0waijyZ systemd[1]: start request repeated too quickly for docker.service
Dec 11 16:52:23 iZhp39y3a2bx21oz0waijyZ systemd[1]: Failed to start Docker Application Container Engine.
Dec 11 16:52:23 iZhp39y3a2bx21oz0waijyZ systemd[1]: Unit docker.service entered failed state.
Dec 11 16:52:23 iZhp39y3a2bx21oz0waijyZ systemd[1]: docker.service failed.
how to solve it?

It seems that the issue does not lie with your running of a registry but with your configuration of the docker service.
Could you link the content of your usr/lib/systemd/system/docker.service file?

Related

Why did docker.service fails after editing daemon.json?

I got
sudo systemctl status docker
● docker.service - Docker Application Container Engine
Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Tue 2022-12-20 10:28:45 CET; 29min ago
TriggeredBy: ● docker.socket
Docs: https://docs.docker.com
Process: 185839 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock (code=exited, status=1/FAILURE)
Main PID: 185839 (code=exited, status=1/FAILURE)
Dec 20 10:28:45 miki-ancic systemd[1]: docker.service: Scheduled restart job, restart counter is at 3.
Dec 20 10:28:45 miki-ancic systemd[1]: Stopped Docker Application Container Engine.
Dec 20 10:28:45 miki-ancic systemd[1]: docker.service: Start request repeated too quickly.
Dec 20 10:28:45 miki-ancic systemd[1]: docker.service: Failed with result 'exit-code'.
Dec 20 10:28:45 miki-ancic systemd[1]: Failed to start Docker Application Container Engine.
I edited /etc/docker/daemon.json
{
"icc" : false,
"userns-remap": "default",
"log-driver": "syslog",
"live-restore": true,
"userland-proxy": false,
"no-new-privileges": true
}
I tried
sudo dockerd --debug
DEBU[2022-12-20T11:04:03.988039125+01:00] Registering POST, /networks/{id:.*}/connect
DEBU[2022-12-20T11:04:03.988200113+01:00] Registering POST, /networks/{id:.*}/disconnect
DEBU[2022-12-20T11:04:03.988360830+01:00] Registering POST, /networks/prune
DEBU[2022-12-20T11:04:03.988510707+01:00] Registering DELETE, /networks/{id:.*}
INFO[2022-12-20T11:04:03.989134350+01:00] API listen on /var/run/docker.sock
How do I debug this issue?
What does Start request repeated too quickly really mean?

Start docker error on Antergos (Arch Linux)

I have installed docker on Antergos (Arch Linux) and followed this guide: https://gist.github.com/simonhoye/3b7312c05a449cd9073f9dc9265f5213
But when I execute sudo sysytemctl start docker I get this error:
Job for docker.service failed because the control process exited with error code.
See "systemctl status docker.service" and "journalctl -xe" for details.
And this is the systemctl status docker.service command:
docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor pres>
Active: failed (Result: exit-code) since Thu 2019-01-17 16:28:01 CET; 5s ago
Docs: https://docs.docker.com
Process: 17013 ExecStart=/usr/bin/dockerd -H fd:// (code=exited, status=1/FAI>
Main PID: 17013 (code=exited, status=1/FAILURE)
ene 17 16:28:01 t480 systemd[1]: docker.service: Service RestartSec=100ms expir>
ene 17 16:28:01 t480 systemd[1]: docker.service: Scheduled restart job, restart>
ene 17 16:28:01 t480 systemd[1]: Stopped Docker Application Container Engine.
ene 17 16:28:01 t480 systemd[1]: docker.service: Start request repeated too qui>
ene 17 16:28:01 t480 systemd[1]: docker.service: Failed with result 'exit-code'.
ene 17 16:28:01 t480 systemd[1]: Failed to start Docker Application Container E>`
I have not idea what is happening... Because the guide and the steps to follow are very simple.
it can be due to many reason so I am listing some common one's
look inside /var/log/syslog for more info.
If you remove /var/lib/docker, you'll lose existing images but it works for many people
Doing so simply wipes all your docker data, and is the equivalent to a "factory reset".
it can also be due to missing kernel module aufs
deleting the /var/run/docker.sock directory that had been created presumably as the docker service was shutting down

Cannot connect to the Docker daemon at unix:///var/run/docker.sock on Ubuntu 16.04

Accidentally, my docker goes wrong, and cannot be started.
docker psgives the following error
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
And systemctl status docker.service gives the following outputs:
● docker.service - Docker Application Container Engine
Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
Drop-In: /etc/systemd/system/docker.service.d
└─override.conf
Active: failed (Result: start-limit-hit) since Tue 2018-11-20 18:27:11 PST; 11s ago
Docs: https://docs.docker.com
Process: 16519 ExecStart=/usr/bin/dockerd --host=fd:// --add-runtime=nvidia=/usr/bin/nvidia-container-runtime (code=exited, status=1/FAILURE)
Main PID: 16519 (code=exited, status=1/FAILURE)
Nov 20 18:27:09 loccalhost systemd[1]: Failed to start Docker Application Container Engine.
Nov 20 18:27:09 loccalhost systemd[1]: docker.service: Unit entered failed state.
Nov 20 18:27:09 loccalhost systemd[1]: docker.service: Failed with result 'exit-code'.
Nov 20 18:27:11 loccalhost systemd[1]: docker.service: Service hold-off time over, scheduling restart.
Nov 20 18:27:11 loccalhost systemd[1]: Stopped Docker Application Container Engine.
Nov 20 18:27:11 loccalhost systemd[1]: docker.service: Start request repeated too quickly.
Nov 20 18:27:11 loccalhost systemd[1]: Failed to start Docker Application Container Engine.
Nov 20 18:27:11 loccalhost systemd[1]: docker.service: Unit entered failed state.
Nov 20 18:27:11 loccalhost systemd[1]: docker.service: Failed with result 'start-limit-hit'.
A more recent answer in the same thread mentioned by skyuua suggests the following (it changes the -H fd:// to -H unix://)
sudo systemctl edit docker.service
[Service]
ExecStart=
ExecStart=/usr/bin/dockerd -H unix:// -H tcp://127.0.0.1:2375
followed by
sudo systemctl daemon-reload
sudo systemctl restart docker.service
On my Ubuntu 16.04 with docker 18.0.3 this rewrites the file /etc/systemd/system/docker.service.d/override.conf which allowed docker to start correctly.
We ran sudo apt-get update, our docker version got updated too, it changed from 18.09.1 to 18.09.3, and docker went haywire. After digging online, I fould following solution that solved issue for us.
sudo systemctl edit docker.service
[Service]
ExecStart=
ExecStart=/usr/bin/dockerd-ce -H unix://var/run/docker.sock -H tcp://0.0.0.0:2375
then restart service
sudo systemctl restart docker.service

docker: docker start fails after creating daemon.json

I am trying to setup awslogs for docker.
The docs say to add this to daemon.json:
{
"log-driver": "awslogs",
"log-opts": {
"awslogs-region": "eu-central-1"
}
}
When I create on Ubuntu /etc/docker/daemon.json with the content above docker wont start again.
Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
Active: inactive (dead) (Result: exit-code) since Fr 2018-07-20 10:59:53 CEST; 11s ago
Docs: https://docs.docker.com
Process: 647 ExecStart=/usr/bin/dockerd -H fd:// (code=exited, status=1/FAILURE)
Main PID: 647 (code=exited, status=1/FAILURE)
Jul 20 10:59:53 dev01-ubuntu systemd[1]: Failed to start Docker Application Container Engine.
Jul 20 10:59:53 dev01-ubuntu systemd[1]: docker.service: Unit entered failed state.
Jul 20 10:59:53 dev01-ubuntu systemd[1]: docker.service: Failed with result 'exit-code'.
Jul 20 10:59:53 dev01-ubuntu systemd[1]: docker.service: Service hold-off time over, scheduling restart.
Jul 20 10:59:53 dev01-ubuntu systemd[1]: Stopped Docker Application Container Engine.
Jul 20 10:59:53 dev01-ubuntu systemd[1]: docker.service: Start request repeated too quickly.
Jul 20 10:59:53 dev01-ubuntu systemd[1]: Failed to start Docker Application Container Engine.
Can anybody explain this behaviour?
Not ever use it.
But from this: https://docs.docker.com/config/containers/logging/plugins/, it seems we need to install plugin for any new log driver, check it with docker plugin ls
Maybe it just available in amazon cloud environment, not available in local pc, just in case you did not notice that.

docker service does not start after creating daemon.json

Following error message appears when doing the steps below
● docker.service - Docker Application Container Engine
Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Wed 2017-08-30 09:21:52 CEST; 13s ago
Docs: https://docs.docker.com
Process: 11581 ExecStart=/usr/bin/dockerd -H fd:// (code=exited, status=1/FAILURE)
Main PID: 11581 (code=exited, status=1/FAILURE)
CPU: 28ms
Aug 30 09:21:52 debian systemd[1]: docker.service: Failed with result 'exit-code'.
Aug 30 09:21:52 debian systemd[1]: docker.service: Service hold-off time over, scheduling restart.
Aug 30 09:21:52 debian systemd[1]: Stopped Docker Application Container Engine.
Aug 30 09:21:52 debian systemd[1]: docker.service: Start request repeated too quickly.
Aug 30 09:21:52 debian systemd[1]: Failed to start Docker Application Container Engine.
Aug 30 09:21:52 debian systemd[1]: docker.service: Unit entered failed state.
Aug 30 09:21:52 debian systemd[1]: docker.service: Failed with result 'exit-code'.
Aug 30 09:22:00 debian systemd[1]: docker.service: Start request repeated too quickly.
Aug 30 09:22:00 debian systemd[1]: Failed to start Docker Application Container Engine.
Aug 30 09:22:00 debian systemd[1]: docker.service: Failed with result 'exit-code'.
I created a fresh Ubuntu 64bit VM on VirtualBox.
Then I used the install script to install docker: https://get.docker.com/
After the installation went successful I tried to configure the daemon to 10.0.2.15:2375 so I can forward it to my Host OS
I ran nano /etc/docker/daemon.json to create the file
I pasted following example into it
{
"debug": true,
"tls": false,
"tlscert": "/var/docker/server.pem",
"tlskey": "/var/docker/serverkey.pem",
"hosts": ["tcp://10.0.2.15:2375"]
}
then I ran service docker restart
running service docker status shows me the message above
Check the docker version of your machine by
docker --version
I was facing the same issue, and it got solved after upgrading the docker to latest version which is available.
Even the documentation available on docker's official website have not mentioned anything like that.
Once you upgrade docker , Restart the docker by
systemctl restart docker
The error will be gone, and new changes will start reflecting

Resources