I installed docker-ce via Install Docker Engine on Ubuntu on a Ubuntu 20.04 machine (AWS EC2). I see
$ sudo docker info
Client: Docker Engine - Community
Version: 27.3.1
Context: default
Debug Mode: false
Plugins:
buildx: Docker Buildx (Docker Inc.)
Version: v0.17.1
Path: /usr/libexec/docker/cli-plugins/docker-buildx
compose: Docker Compose (Docker Inc.)
Version: v2.29.7
Path: /usr/libexec/docker/cli-plugins/docker-compose
Server:
ERROR: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
errors pretty printing info
I see
$ ls -al /var/run/docker.sock
srw-rw---- 1 root docker 0 Dec 3 23:39 /var/run/docker.sock
But starting the service fails
$ sudo systemctl start docker.service
Job for docker.service failed because the control process exited with error code.
See "systemctl status docker.service" and "journalctl -xe" for details.
…and…
$ journalctl -xe
-- Automatic restarting of the unit docker.service has been scheduled, as the result for
-- the configured Restart= setting for the unit.
Dec 03 23:49:50 ip-10-23-21-53 systemd[1]: Stopped Docker Application Container Engine.
-- Subject: A stop job for unit docker.service has finished
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- A stop job for unit docker.service has finished.
--
-- The job identifier is 2019 and the job result is done.
Dec 03 23:49:50 ip-10-23-21-53 systemd[1]: docker.service: Start request repeated too quickly.
Dec 03 23:49:50 ip-10-23-21-53 systemd[1]: docker.service: Failed with result 'exit-code'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- The unit docker.service has entered the 'failed' state with result 'exit-code'.
Dec 03 23:49:50 ip-10-23-21-53 systemd[1]: Failed to start Docker Application Container Engine.
-- Subject: A start job for unit docker.service has failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- A start job for unit docker.service has finished with a failure.
--
-- The job identifier is 2019 and the job result is failed.
Dec 03 23:49:50 ip-10-23-21-53 systemd[1]: docker.socket: Failed with result 'service-start-limit-hit'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- The unit docker.socket has entered the 'failed' state with result 'service-start-limit-hit'.
I can however start it with
$ nohup sudo dockerd &
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
I’ve rebooted the machine. What am I missing? Thanks.