Installing docker on Fedora 31

A few days ago Fedora 31 was released and we are all excited to try it out, you can install docker-ce on it by simple following the steps given in docker documention, or by following the steps given below. But even after the installation running the docker container will throw some error as follows:

This is beacaue Fedora 31 uses cgroups v2 by default and docker doesn’t yet support cgroupsv2, which may be added soon as docker is most used container runtime. In this tutorial I am going to show you how to install docker and change cgroups to v1 as a quick fix to run docker. So Let’s go.

  1. Add Docker repo.

2. Install docker.

this will install docker-ce and all its dependencies

Optionally , configure docker to be run by non-root user.

3. Change Kernel Boot Options.

Open default grub config.

sudo gedit /etc/default/grub

Now in to the line starting with GRUB_CMDLINE_LINUX, add the parameter systemd.unified_cgroup_hierarchy=0 as shown below and save it.

Now update the grub by running grub2-mkconfig, and reboot the system on success.

And now you have docker installed and running on your Fedora 31.

Thank you.



Curious about Tech and Producing Electronic Music

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store