Installing Docker Engine on Fedora
Installing Docker Engine on Fedora
Uninstall old versions
Older versions of Docker were called docker or docker-engine. If these are installed, uninstall them, along with associated dependencies.
sudo dnf remove docker \ |
Set up the dnf repository
Install the dnf-plugins-core package (which provides the commands to manage your DNF repositories) and set up the repository.
sudo dnf -y install dnf-plugins-core |
Install Docker Engine
-
Install the latest version of Docker Engine, containerd, and Docker Compose or go to the next step to install a specific version:
sudo dnf install docker-ce docker-ce-cli containerd.io docker-compose-plugin
If prompted to accept the GPG key, verify that the fingerprint matches
060A 61C5 1B55 8A7F 742B 77AA C52F EB6B 621E 9F35, and if so, accept it.This command installs Docker, but it doesn’t start Docker. It also creates a
dockergroup, however, it doesn’t add any users to the group by default. -
To install a specific version of Docker Engine, list the available versions in the repo, then select and install:
a. List and sort the versions available in your repo. This example sorts results by version number, highest to lowest, and is truncated:
~]$ dnf list docker-ce --showduplicates | sort -r
docker-ce.x86_64 3:18.09.1-3.fc28 docker-ce-stabledocker-ce.x86_64 3:18.09.0-3.fc28 docker-ce-stabledocker-ce.x86_64 18.06.1.ce-3.fc28 docker-ce-stabledocker-ce.x86_64 18.06.0.ce-3.fc28 docker-ce-stableThe list returned depends on which repositories are enabled, and is specific to your version of Fedora (indicated by the
.fc28suffix in this example).b. Install a specific version by its fully qualified package name, which is the package name (
docker-ce) plus the version string (2nd column) up to the first hyphen, separated by a hyphen (-), for example,docker-ce-3:18.09.1.sudo dnf -y install docker-ce-<VERSION_STRING> docker-ce-cli-<VERSION_STRING> containerd.io docker-compose-plugin
This command installs Docker, but it doesn’t start Docker. It also creates a
dockergroup, however, it doesn’t add any users to the group by default. -
Start Docker.
sudo systemctl start docker
-
Verify that Docker Engine is installed correctly by running the
hello-worldimage.sudo docker run hello-world
This command downloads a test image and runs it in a container. When the container runs, it prints a message and exits.
This installs and runs Docker Engine. Use sudo to run Docker commands. Continue to Linux postinstall to allow non-privileged users to run Docker commands and for other optional configuration steps.
Uninstall Docker Engine
-
Uninstall the Docker Engine, CLI, Containerd, and Docker Compose packages:
sudo dnf remove docker-ce docker-ce-cli containerd.io docker-compose-plugin
-
Images, containers, volumes, or customized configuration files on your host are not automatically removed. To delete all images, containers, and volumes:
sudo rm -rf /var/lib/docker
sudo rm -rf /var/lib/containerd
You must delete any edited configuration files manually.
Troubleshooting
Issue: docker: Error response from daemon: Get "https://registry-1.docker.io/v2/": net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers).
Workaroud:
sudo tee /etc/docker/daemon.json <<EOF |
Reference:





