I followed the steps provided in the documentation here to add tls security for docker api. Certificates are located in ~/.docker/ as well as /etc/docker/ssl/ folders. I added override.conf to /etc/systemd/system/docker.service.d/ with content
[Service]
ExecStart=
ExecStart=/usr/bin/dockerd -H tcp://0.0.0.0:2376 --tlsverify --tlscacert=ca.pem --tlscert=server-cert.pem --tlskey=server-key.pem
Then, I used daemon-reload and docker start
$ systemctl daemon-reload
$ service docker start
The errors in journalctl -xe is:
-- Unit docker.socket has finished starting up.
--
-- The start-up result is RESULT.
Jan 15 21:43:24 cynicalplyaground systemd[1]: docker.service: Start request repeated too quickly.
Jan 15 21:43:24 cynicalplyaground systemd[1]: docker.service: Failed with result 'exit-code'.
Jan 15 21:43:24 cynicalplyaground systemd[1]: Failed to start Docker Application Container Engine.
-- Subject: Unit docker.service has failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit docker.service has failed.
--
-- The result is RESULT.
Jan 15 21:43:24 cynicalplyaground systemd[1]: docker.socket: Failed with result 'service-start-limit-hit'.
Jan 15 21:45:01 cynicalplyaground CRON[12768]: pam_unix(cron:session): session opened for user root by (uid=0)
Jan 15 21:45:01 cynicalplyaground CRON[12769]: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 1 1)
Jan 15 21:45:01 cynicalplyaground CRON[12768]: pam_unix(cron:session): session closed for user root
How can I sort this issue?
11
Answers
In the present case the same error occured after the latest manjaro update (2020-01-20).
Tried to change the systemd docker service, as adviced in other cases, but I reverted those changes and finally this was solved with:
(like advised here: https://www.reddit.com/r/archlinux/comments/7ya4ug/installing_docker_on_arch_linux/)
I have the same issue and just modify the "/usr/bin/dockerd" to "/usr/sbin/dockerd", then it works.
You can check the dockerd path first.
For me it was because the docker installer uses iptables for nat. Unfortunately Debian uses nftables. You can convert the entries over to nftables or just setup Debian to use the legacy iptables.
dockerd, should start fine after switching to iptables-legacy.
I was able to solve the problem by disabling the firewalld
in my case… the host was part of a docker swarm…but the IPv6 was no longer reachable or automatically assigned to the host…
I manually add the old_IPv6
the journalctl -u docker.service mention:
after add manually the IPv6 I was able to start docker so with docker running I leave the "swarm" and reboot
after reboot the docker services run as usual
Getting to the root of the problem;
has this:
/usr/bin/dockerd -H fd:// –containerd=/run/containerd/containerd.sock
Trying to run that command, it complains about
unable to configure the Docker daemon with file /etc/docker/daemon.json: EOF
NOTE that the JSON file is empty. Delete it.
For me it was missing disk space. Reboot also helped, but I was stillnot able to build any container.
After pruning some outdated stuff from the docker volumes I was able to continue.
I faced a similar issue on Ubuntu because I added the
hosts
option to/etc/docker/daemon.json
file. That’s ok, but for systems that usesystemd
it may cause conflict with the arguments passed todockerd
on start.The solution was to delete the
/etc/docker/daemon.json
‘shosts
entry and set this config on file/etc/systemd/system/docker.service.d/options.conf
.After that, restart the service.
You may check that your changes has been applied by running
docker info
. Also, you may note on the docker service status thatDrop-In
field is using theoptions.conf
created, anddockerd
was executed with the specified host list.References:
I had a similar issue on nixOS installed in a btrfs filesystem.
For me the solution was to add
virtualisation.docker.storageDriver = "btrfs";
to my/etc/nixos/configuration.nix
Which according to the docker docs should equate to adding the following to
/etc/docker/daemon.json
in most other distros:I had a similar issue and tried
rebooting
as above and also modifying thedocker.service
to remove the-H fd://
argument as well.However, I kept getting the following:
Closer inspection shows that the socket is listening at
/run/docker.sock
but prompted me to look in/var/run
. There (due to a previous version) I had a folder called/var/run/docker/plugins
.Removing
/var/run/docker
enabled thedocker.socket
service to start and and enabledocker.service
to start.Running
Ubuntu 20.04.6 LTS
.I had same problem on CentOS 7 after upgrade of obsolete
docker
package todocker-ce
.It appeared that bridge
docker0
left enabled in firewall conf after old package removal and docker service start failed when attempted to enable already enabled interface.solved the problem.