I am trying to install docker on a machine via:
apt-get --allow-downgrades -yq install docker-ce=18.06.3*
This causes an error during the post-installation script:
● docker.service - Docker Application Container Engine
Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
Active: activating (auto-restart) (Result: exit-code) since Thu 2021-09-02 18:17:18 EDT; 3ms ago
Docs: https://docs.docker.com
Process: 17110 ExecStart=/usr/bin/dockerd -H fd:// (code=exited, status=1/FAILURE)
Main PID: 17110 (code=exited, status=1/FAILURE)
dpkg: error processing package docker-ce (--configure):
installed docker-ce package post-installation script subprocess returned error exit status 1
Processing triggers for systemd (237-3ubuntu10.51) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Processing triggers for ureadahead (0.100.0-21) ...
Errors were encountered while processing:
docker-ce
Looking into journalctl -xe:
-- Unit docker.service has begun starting up.
Sep 02 16:44:20 office64-001 dockerd[20320]: Failed to load listeners: no sockets found via socket activation: make sure the service was started by systemd
Sep 02 16:44:20 office64-001 systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE
Sep 02 16:44:20 office64-001 systemd[1]: docker.service: Failed with result 'exit-code'.
Sep 02 16:44:20 office64-001 systemd[1]: Failed to start Docker Application Container Engine.
The error above happens at 16:44:20. Then, looking at the output of journalctl -u docker.socket:
Sep 02 16:44:21 office64-001 systemd[1]: Starting Docker Socket for the API.
Sep 02 16:44:21 office64-001 systemd[1]: Listening on Docker Socket for the API.
The socket appears to become active a second after the error above.
After this, docker attempts to restart and succeeds, as the socket has had a chance to become active. However, it is my understanding that docker.service should wait for docker.socket to be ready. From docker.service:
[Unit]
Description=Docker Application Container Engine
Documentation=https://docs.docker.com
After=network-online.target docker.socket firewalld.service
Wants=network-online.target
Requires=docker.socket
My problem is I have a script that fails whenever the installation fails, so even if it appears that docker is properly installed, it causes issues at the time of installation that prevents the script from running properly.
Any ideas?