I am trying to figure out why my docker service doesn't run automatically on reboot.
Here it is:
$ sudo cat /etc/systemd/system/docker.service
[Service]
ExecStart=
ExecStart=/usr/bin/dockerd --insecure-registry=some-registry
When I try:
$ sudo systemctl enable docker.service
nothing happens.
The status of this service under list-unit-files:
$ sudo systemctl list-unit-files | grep docker
docker.service static
If I start the service manually (sudo systemctl start docker.service) it works as expected though.
Any ideas why?
The issue is because you have not specified any target in your service. You should change the service file as below
$ sudo cat /etc/systemd/system/docker.service
[Service]
ExecStart=
ExecStart=/usr/bin/dockerd --insecure-registry=some-registry
[Install]
WantedBy=multi-user.target
After that run the below commands
systemctl daemon-reload
systemctl disable docker
systemctl enable docker
And restart the system
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With