Problem Starting Docker

Hello everyone.

I’m trying to install docker (for the first time) into a proxmox LXC container and I am having trouble getting it going. The OS I’m using is Linux Ubuntu Server v22.04.

I did my best following the installation guide from the following link: (https) docs (dot) docker (dot) com/engine/install/ubuntu/

The problem I’m having is that when I try to run docker using the command

sudo service docker start

I get the following error:
A dependency job for docker (dot) service failed. See ‘journalctl -xe’ for details.

Here is what I receive after typing the journalctl -xe command:

– A start job for unit docker (dot) socket has begun execution.

– The job identifier is 233.
Jun 14 18:47:20 KubernetesUbuntu systemd[331]: docker (dot) socket: Failed to resolve group docker: No such process
Jun 14 18:47:20 KubernetesUbuntu systemd[1]: docker (dot) socket: Control process exited, code=exited, status=216/GROUP
– Subject: Unit process exited
– Defined-By: systemd
– Support: (http) www (dot) ubuntu (dot) com/support

– An ExecStartChown= process belonging to unit docker (dot) socket has exited.

– The process’ exit code is ‘exited’ and its exit status is 216.
Jun 14 18:47:20 KubernetesUbuntu systemd[1]: docker (dot) socket: Failed with result ‘exit-code’.
– Subject: Unit failed
– Defined-By: systemd
– Support: (http) www (dot) ubuntu (dot) com/support

– The unit docker.socket has entered the ‘failed’ state with result ‘exit-code’.
Jun 14 18:47:20 KubernetesUbuntu systemd[1]: Failed to listen on Docker Socket for the API.
– Subject: A start job for unit docker.socket has failed
– Defined-By: systemd
– Support: (http) www (dot) ubuntu (dot) com/support

– A start job for unit docker (dot) socket has finished with a failure.

– The job identifier is 233 and the job result is failed.
Jun 14 18:47:20 KubernetesUbuntu systemd[1]: Dependency failed for Docker Application Container Engine.
– Subject: A start job for unit docker.service has failed
– Defined-By: systemd
– Support: (http) www (dot) ubuntu (dot) com/support

– A start job for unit docker.service has finished with a failure.

– The job identifier is 179 and the job result is dependency.
Jun 14 18:47:20 KubernetesUbuntu sudo[322]: pam_unix(sudo:session): session closed for user root
Jun 14 18:47:20 KubernetesUbuntu systemd[1]: docker.service: Job docker.service/start failed with result ‘dependency’.
lines 5474-5510/5510 (END)

Note that I edited the output to remove periods and http from it because it’s not letting me post a topic with more than 2 links in it.

To try solving this problem, I spent some time searching around on the internet (including here) to no avail. It seems that people are having similar problems from different reasons and the error message is too vague to be helpful (at least to me). I also tried checking the dependencies to make sure everything was there by running apt show {each of the 5 specific docker packages} and manually looked through all of the installed packages (using apt list --installed) to make sure each dependency was installed with at least the appropriate version and each one is installed.

So how should I go about getting past this?

The only two things I can think of at this time are:

  1. When I first tried installing docker, I followed the apt repository route. I got through the apt-get update part. I got through the get docker’s official GPG key part. However, when setting up the repository and trying to install docker from it, it had an issue finding the appropriate ip address and didn’t work/install. Note that I did this a week or so ago (before I started trying to figure this out myself) so I don’t know which actual step it happened on nor do I have a copy of the output from it. I eventually installed docker using the deb packages so do you think the steps from the apt depository might have messed it up? Maybe there’s some conflict somewhere between what was installed during the apt repository attempt and what was installed during the install from packages attempt? If so, how would I go about figuring out / undoing whatever section of the apt-repository install is causing the issue?
  2. The only other thing I can think of that might be causing the issue would be that maybe I have too new of a version of one of the 5 docker packages and I need to roll back one. I did this by using the wget command to download each of the 5 docker packages (i.e., containerd.io, docker-ce, docker-ce-cli, docker-buildx-plugin, and docker-compose-plugin) from the /pool/stable/ section and then installed each of them, one-at-a-time, using the dpkg command. Do you think that maybe I need to roll one of these back to an older version to get it to work?

What do you think? How should I go about fixing this? Thanks in advance for your time/replies.

So I got it working now. I simply uninstalled everything and then reinstalled it and now it works.

Just in case someone else finds themselves here in the future, here are some things to note that might help (note that I’m not 100% sure if you need to do everything listed here, however, doing everything listed here worked for me):

  1. I started by completely removing everything (or at least I think it was everything; it’s possible that there was more docker stuff hidden around the VM). Go though each of the installed docker packages and remove each of them, one-at-a-time, using the following command: sudo apt-get purge --auto-remove . To the best of my knowledge at this time, this command completely removes everything associated with the package, including building a dependency tree and removing all those as well. In addition to the five basic docker packages (i.e., containerd.io, docker-ce, docker-ce-cli, docker-buildx-plugin, and docker-compose-plugin), I also removed the three repository setup packages (i.e., ca-certificates, curl, and gnupg). Note that removing ca-certificates was probably not necessary as I eventually had to reinstall it (see below). I also completely removed the /var/lib/docker directory (note that, according to other forums that doing this will also remove your images; I don’t have any images yet so this didn’t matter for me but it might for you so be cautious with deleting this directory and/or try not deleting it).
  2. At this point a ran a sudo apt-get update and noticed that it was still trying to update docker stuff (and failing/ignoring it) so I went and deleted those references as well. I could imagine this isn’t required but I did it so I’m including it here. Located in the /apt/get/ directory was a keyrings directory containing a file called docker.gpg. I navigated to the keyrings directory and used sudo rmdir docker.gpg and then went up a directory and used sudo rmdir keyrings to remove that reference file. Also in the /etc/apt/ directory is another directory called sources.list.d containing the file docker.list. I followed the same procedure to delete those as well. Now when running sudo apt-get update, it no longer tried to update docker stuff.
  3. Now I reinstalled docker from the deb files. I used the same files as the previous attempt and, since it worked the second time around, I can conclude that there’s no conflicts between the newest versions of the five main docker packages and they don’t need to be rolled back.
  4. At this point, I ran another sudo apt-get update, then tried starting docker using sudo service docker start and it worked with no errors. However, when attempting to run sudo docker run hello-world, I received an error that the daemon couldn’t verify the SSL certificate because it was signed by an unknown authority. So I reinstalled the ca-certificates package. I also did another sudo apt-get update and also restarted docker. Now it worked and I got the hello world message when running sudo docker run hello-world.

Anyways hope this helps someone out who finds themselves here in the future.