1

I have recently started using Fedora workstation 32 and i needed to install docker in it and i went for using snap for it. The installation went well along with post installation steps. But the docker snap gives the following prompt when i try to run,

$ docker run hello-world

WARNING: cgroup v2 is not fully supported yet, proceeding with partial confinement
docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?.
See 'docker run --help'.

So i go ahead and run

$ sudo snap start docker
Started.

$ sudo snap services docker
Service         Startup  Current  Notes
docker.dockerd  enabled  active   -

Then when i run docker run hello-world i get the same prompt saying the can't connect to docker daemon. When i inspect the docker snap services, i get,

Service         Startup  Current   Notes
docker.dockerd  enabled  inactive  -

The active service switches back to inactive state when i try to run docker run command. Any help fixing this issue is appreciated. Thank you :)

1 Answer 1

0

Fedora 31 and 32 use cgroup v2 by default, and Docker doesn’t support that (yet).

You have two options: one is to use Podman instead of Docker (optionally, with the podman-docker package so that it emulates the Docker CLI), or switch back to cgroup v1.

To do the latter, set the systemd.unified_cgroup_hierarchy kernel parameter to 0:

sudo dnf install grubby
sudo grubby --update-kernel=ALL --args="systemd.unified_cgroup_hierarchy=0"

This will allow Docker to run (after a reboot).

Incidentally, on Fedora, you can install Docker using the moby-engine package, instead of using the Docker snap.

1
  • 1
    Thank you. I managed to use podman instead of docker. Less hassle. :)
    – user412151
    May 13, 2020 at 10:31

You must log in to answer this question.