Saturday, December 28, 2024
Google search engine
HomeData Modelling & AIInstall Docker CE on Fedora 38/37/36/35/34/33

Install Docker CE on Fedora 38/37/36/35/34/33

.tdi_3.td-a-rec{text-align:center}.tdi_3 .td-element-style{z-index:-1}.tdi_3.td-a-rec-img{text-align:left}.tdi_3.td-a-rec-img img{margin:0 auto 0 0}@media(max-width:767px){.tdi_3.td-a-rec-img{text-align:center}}

Welcome to our guide on how to install Docker CE on Fedora 38/37/36/35/34/33 Linux distribution. The release of Docker we’ll install is Docker Community Edition (CE). Docker is a leading container runtime engine that allows you to package your applications with all of its dependencies into a standardized unit for software development.

Follow the steps below to install Docker CE on Fedora 38/37/36/35/34/33 Linux system.

Step 1: Update your system

Before we install Docker on Fedora Linux machine, we’ll start our installations by updating and upgrading OS packages. On Fedora, this can be easily done by running the command:

.tdi_2.td-a-rec{text-align:center}.tdi_2 .td-element-style{z-index:-1}.tdi_2.td-a-rec-img{text-align:left}.tdi_2.td-a-rec-img img{margin:0 auto 0 0}@media(max-width:767px){.tdi_2.td-a-rec-img{text-align:center}}

sudo dnf -y update

It is recommended to reboot your system after an upgrade

sudo reboot

Step 2: Add Docker CE repository

After upgrading system packages and rebooting the server, proceed to add Fedora repository to your system:

sudo dnf -y install dnf-plugins-core

Fedora 38:

sudo tee /etc/yum.repos.d/docker-ce.repo<<EOF
[docker-ce-stable]
name=Docker CE Stable - \$basearch
baseurl=https://download.docker.com/linux/fedora/37/\$basearch/stable
enabled=1
gpgcheck=1
gpgkey=https://download.docker.com/linux/fedora/gpg
EOF

Fedora 37:

sudo tee /etc/yum.repos.d/docker-ce.repo<<EOF
[docker-ce-stable]
name=Docker CE Stable - \$basearch
baseurl=https://download.docker.com/linux/fedora/37/\$basearch/stable
enabled=1
gpgcheck=1
gpgkey=https://download.docker.com/linux/fedora/gpg
EOF

Fedora 36:

sudo tee /etc/yum.repos.d/docker-ce.repo<<EOF
[docker-ce-stable]
name=Docker CE Stable - \$basearch
baseurl=https://download.docker.com/linux/fedora/36/\$basearch/stable
enabled=1
gpgcheck=1
gpgkey=https://download.docker.com/linux/fedora/gpg
EOF

Fedora 35:

sudo tee /etc/yum.repos.d/docker-ce.repo<<EOF
[docker-ce-stable]
name=Docker CE Stable - \$basearch
baseurl=https://download.docker.com/linux/fedora/35/\$basearch/stable
enabled=1
gpgcheck=1
gpgkey=https://download.docker.com/linux/fedora/gpg
EOF

Fedora 34:

sudo tee /etc/yum.repos.d/docker-ce.repo<<EOF
[docker-ce-stable]
name=Docker CE Stable - \$basearch
baseurl=https://download.docker.com/linux/fedora/34/\$basearch/stable
enabled=1
gpgcheck=1
gpgkey=https://download.docker.com/linux/fedora/gpg
EOF

Fedora 33:

sudo tee /etc/yum.repos.d/docker-ce.repo<<EOF
[docker-ce-stable]
name=Docker CE Stable - \$basearch
baseurl=https://download.docker.com/linux/fedora/33/\$basearch/stable
enabled=1
gpgcheck=1
gpgkey=https://download.docker.com/linux/fedora/gpg
EOF

Step 3: Install Docker CE on Fedora

Now that you have your repository ready, install the latest stable release of Docker CE on your machine by running:

sudo dnf makecache -y
sudo dnf install docker-ce docker-ce-cli containerd.io -y

Press the y key when prompted to start the installation.

....
Transaction Summary
======================================================================================================================================================================================================
Install  20 Packages

Total download size: 91 M
Installed size: 355 M
Is this ok [y/N]: y

And accept to import GPG key:

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                                  57 MB/s |  91 MB     00:01
Docker CE Stable - x86_64                                                                                                                                              19 kB/s | 1.6 kB     00:00
Importing GPG key 0x621E9F35:
 Userid     : "Docker Release (CE rpm) <[email protected]>"
 Fingerprint: 060A 61C5 1B55 8A7F 742B 77AA C52F EB6B 621E 9F35
 From       : https://download.docker.com/linux/fedora/gpg
Is this ok [y/N]: y

Docker will be installed but not started. To start the docker service, run:

sudo systemctl enable --now docker

You can check status with:

$ systemctl status docker
 docker.service - Docker Application Container Engine
     Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; preset: disabled)
     Active: active (running) since Thu 2023-01-19 15:10:29 UTC; 14s ago
TriggeredBy: ● docker.socket
       Docs: https://docs.docker.com
   Main PID: 3891 (dockerd)
      Tasks: 8
     Memory: 21.7M
        CPU: 541ms
     CGroup: /system.slice/docker.service
             └─3891 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock

Jan 19 15:10:29 fedora.mylab.io dockerd[3891]: time="2023-01-19T15:10:29.079090523Z" level=info msg="scheme \"unix\" not registered, fallback to default scheme" module=grpc
Jan 19 15:10:29 fedora.mylab.io dockerd[3891]: time="2023-01-19T15:10:29.079117024Z" level=info msg="ccResolverWrapper: sending update to cc: {[{unix:///run/containerd/containerd.sock  <nil> 0 <nil>
Jan 19 15:10:29 fedora.mylab.io dockerd[3891]: time="2023-01-19T15:10:29.079132493Z" level=info msg="ClientConn switching balancer to \"pick_first\"" module=grpc
Jan 19 15:10:29 fedora.mylab.io dockerd[3891]: time="2023-01-19T15:10:29.162510610Z" level=info msg="Loading containers: start."
Jan 19 15:10:29 fedora.mylab.io dockerd[3891]: time="2023-01-19T15:10:29.584131935Z" level=info msg="Default bridge (docker0) is assigned with an IP address 172.17.0.0/16. Daemon option --bip can b>
Jan 19 15:10:29 fedora.mylab.io dockerd[3891]: time="2023-01-19T15:10:29.687301126Z" level=info msg="Loading containers: done."
Jan 19 15:10:29 fedora.mylab.io dockerd[3891]: time="2023-01-19T15:10:29.744443655Z" level=info msg="Docker daemon" commit=42c8b31 graphdriver(s)=overlay2 version=20.10.22
Jan 19 15:10:29 fedora.mylab.io dockerd[3891]: time="2023-01-19T15:10:29.744815902Z" level=info msg="Daemon has completed initialization"
Jan 19 15:10:29 fedora.mylab.io systemd[1]: Started docker.service - Docker Application Container Engine.
Jan 19 15:10:29 fedora.mylab.io dockerd[3891]: time="2023-01-19T15:10:29.856497735Z" level=info msg="API listen on /run/docker.sock"

The docker group is created, but no users are added to the group. Add your user to this group to run docker commands without sudo.

sudo usermod -aG docker $(whoami)
newgrp docker

Logout and Login again to use Docker without sudo. The version of Docker installed can be checked with:

$ docker version
Client: Docker Engine - Community
 Version:           20.10.22
 API version:       1.41
 Go version:        go1.18.9
 Git commit:        3a2c30b
 Built:             Thu Dec 15 22:28:45 2022
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          20.10.22
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.18.9
  Git commit:       42c8b31
  Built:            Thu Dec 15 22:26:25 2022
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.6.15
  GitCommit:        5b842e528e99d4d4c1686467debf2bd4b88ecd86
 runc:
  Version:          1.1.4
  GitCommit:        v1.1.4-0-g5fd4c4d
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

This shows both Client and Engine versions.

Step 4: Pull Test docker image

The last step is to test your installation by downloading a test docker container.

$ docker pull alpine
Using default tag: latest
latest: Pulling from library/alpine
df9b9388f04a: Pull complete
Digest: sha256:4edbd2beb5f78b1014028f4fbb99f3237d9561100b6881aabbf5acce2c4f9454
Status: Downloaded newer image for alpine:latest
docker.io/library/alpine:latest

Verify that Docker CE is installed correctly by running the alpine image.

$ docker run -it --rm alpine /bin/sh
/ # apk update
fetch https://dl-cdn.alpinelinux.org/alpine/v3.15/main/x86_64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.15/community/x86_64/APKINDEX.tar.gz
v3.15.4-150-g2cac749901 [https://dl-cdn.alpinelinux.org/alpine/v3.15/main]
v3.15.4-149-g06cc714d68 [https://dl-cdn.alpinelinux.org/alpine/v3.15/community]
OK: 15857 distinct packages available
/ # exit

That’s all. You now have Docker running on your Fedora system. The next reading is:

To setup a Docker registry, check our guide on how to:

Please check our guide on managing Docker containers through a web interface:

For easy monitoring, you can use:

For installation of Docker on other systems, use:

Don’t forget to check other Fedora articles available on our website.

.tdi_4.td-a-rec{text-align:center}.tdi_4 .td-element-style{z-index:-1}.tdi_4.td-a-rec-img{text-align:left}.tdi_4.td-a-rec-img img{margin:0 auto 0 0}@media(max-width:767px){.tdi_4.td-a-rec-img{text-align:center}}

RELATED ARTICLES

Most Popular

Recent Comments