How to install Docker on Fedora 34
- 00:36 cat /etc/os-release
- 00:54 dnf -y install dnf-plugins-core
-
01:21
sudo tee /etc/yum.repos.d/docker-ce.repo<
- 01:40 dnf makecache
- 02:10 dnf install docker-ce docker-ce-cli containerd.io
- 03:16 systemctl start docker
- 03:35 systemctl enable docker
- 03:53 systemctl status docker
- 04:17 docker run hello-world
To Install Docker on Fedora 34
Introduction:
Docker is an operating system virtualization technology that enables packages of files to be packaged as containers. The fundamental principle of cloud computing is that containerized applications run on any infrastructure, regardless of its provider.
Step 1: Check the OS version by using the below command
[root@linuxhelp ~]# cat /etc/os-release
NAME=Fedora
VERSION="34 (Workstation Edition)"
ID=fedora
VERSION_ID=34
VERSION_CODENAME=""
PLATFORM_ID="platform:f34"
PRETTY_NAME="Fedora 34 (Workstation Edition)"
ANSI_COLOR="0;38;2;60;110;180"
LOGO=fedora-logo-icon
BUG_REPORT_URL="https://bugzilla.redhat.com/"
REDHAT_BUGZILLA_PRODUCT="Fedora"
REDHAT_BUGZILLA_PRODUCT_VERSION=34
REDHAT_SUPPORT_PRODUCT="Fedora"
REDHAT_SUPPORT_PRODUCT_VERSION=34
PRIVACY_POLICY_URL="https://fedoraproject.org/wiki/Legal:PrivacyPolicy"
VARIANT="Workstation Edition"
VARIANT_ID=workstation
Step 2: Install plugins-core packages by using the below command
[root@linuxhelp ~]# dnf -y install dnf-plugins-core
Fedora 34 openh264 (From Cisco) - x86_64 790 B/s | 989 B 00:01
Fedora Modular 34 - x86_64 6.0 kB/s | 5.6 kB 00:00
Fedora Modular 34 - x86_64 - Updates 5.6 kB/s | 4.9 kB 00:00
Fedora Modular 34 - x86_64 - Updates 292 kB/s | 826 kB 00:02
Fedora 34 - x86_64 - Updates 5.1 kB/s | 4.2 kB 00:00
Fedora 34 - x86_64 - Updates 1.0 MB/s | 13 MB 00:12
Fedora 34 - x86_64 6.7 kB/s | 5.7 kB 00:00
MySQL 8.0 Community Server 36 kB/s | 2.6 kB 00:00
MySQL 8.0 Community Server 10 MB/s | 1.0 MB 00:00
MySQL Connectors Community 216 kB/s | 2.6 kB 00:00
MySQL Connectors Community 934 kB/s | 36 kB 00:00
MySQL Tools Community 183 kB/s | 2.6 kB 00:00
MySQL Tools Community 3.6 MB/s | 239 kB 00:00
determining the fastest mirror (44 hosts).. done.==============================] 9.3 kB/s | 3.5 kB 00:00 ETA
Remi's Modular repository - Fedora 34 - x86_64 266 B/s | 858 B 00:03
done.s Modular repository - Fedora 34100% [====================================] 11 kB/s | 3.5 kB 00:00 ETA
Remi's Modular repository - Fedora 34 - x86_64 471 kB/s | 517 kB 00:01
Remi's RPM repository - Fedora 34 - x86_64 1.2 kB/s | 858 B 00:00
Remi's RPM repository - Fedora 34 - x86_64 2.5 MB/s | 3.0 MB 00:01
Package dnf-plugins-core-4.0.19-1.fc34.noarch is already installed.
Dependencies resolved.
Nothing to do.
Complete!
Step 3: Add Docker Repository by using the below command
[root@linuxhelp ~]# 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
[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
Step 4: Then run the mackecache command by using the below command
[root@linuxhelp ~]# dnf makecache
Docker CE Stable - x86_64 74 kB/s | 12 kB 00:00
Fedora 34 openh264 (From Cisco) - x86_64 1.1 kB/s | 989 B 00:00
Fedora Modular 34 - x86_64 6.9 kB/s | 5.6 kB 00:00
Fedora Modular 34 - x86_64 - Updates 5.8 kB/s | 4.9 kB 00:00
Fedora 34 - x86_64 - Updates 5.9 kB/s | 4.2 kB 00:00
Fedora 34 - x86_64 6.6 kB/s | 5.7 kB 00:00
MySQL 8.0 Community Server 15 kB/s | 2.6 kB 00:00
MySQL Connectors Community 252 kB/s | 2.6 kB 00:00
MySQL Tools Community 334 kB/s | 2.6 kB 00:00
Remi's Modular repository - Fedora 34 - x86_64 1.3 kB/s | 858 B 00:00
Remi's RPM repository - Fedora 34 - x86_64 1.2 kB/s | 858 B 00:00
Metadata cache created.
Step 5 : Install Docker packages by using the below command
[root@linuxhelp ~]# dnf install docker-ce docker-ce-cli containerd.io
Last metadata expiration check: 0:00:48 ago on Fri 28 Jan 2022 12:16:25 AM IST.
Dependencies resolved.
=================================================================================================================
Package Architecture Version Repository Size
=========================================================================================================
Installed:
containerd.io-1.4.12-3.1.fc34.x86_64 docker-ce-3:20.10.12-3.fc34.x86_64
docker-ce-cli-1:20.10.12-3.fc34.x86_64 docker-ce-rootless-extras-20.10.12-3.fc34.x86_64
docker-scan-plugin-0.12.0-3.fc34.x86_64 libcgroup-0.42.2-4.fc34.x86_64
Complete!
Step 6 : start the Docker services by using the below command
[root@linuxhelp ~]# systemctl start docker
Step 7 : Enable the Docker service by using the below command
[root@linuxhelp ~]# systemctl enable docker
Created symlink /etc/systemd/system/multi-user.target.wants/docker.service → /usr/lib/systemd/system/docker.service.
Step 8 : check the Docker status by using the below command
[root@linuxhelp ~]# systemctl status docker
● docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled)
Active: active (running) since Fri 2022-01-28 00:18:07 IST; 36s ago
TriggeredBy: ● docker.socket
Docs: https://docs.docker.com
Main PID: 26100 (dockerd)
Tasks: 7
Memory: 26.5M
CPU: 387ms
CGroup: /system.slice/docker.service
└─26100 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
Jan 28 00:18:06 linuxhelp dockerd[26100]: time="2022-01-28T00:18:06.197954469+05:30" level=info msg="scheme \"un>
Jan 28 00:18:06 linuxhelp dockerd[26100]: time="2022-01-28T00:18:06.198087056+05:30" level=info msg="ccResolverW>
Jan 28 00:18:06 linuxhelp dockerd[26100]: time="2022-01-28T00:18:06.198204882+05:30" level=info msg="ClientConn >
Jan 28 00:18:06 linuxhelp dockerd[26100]: time="2022-01-28T00:18:06.309187691+05:30" level=info msg="Loading con>
Jan 28 00:18:06 linuxhelp dockerd[26100]: time="2022-01-28T00:18:06.831112068+05:30" level=info msg="Default bri>
Jan 28 00:18:07 linuxhelp dockerd[26100]: time="2022-01-28T00:18:07.244901982+05:30" level=info msg="Loading con>
Jan 28 00:18:07 linuxhelp dockerd[26100]: time="2022-01-28T00:18:07.297768235+05:30" level=info msg="Docker daem>
Jan 28 00:18:07 linuxhelp dockerd[26100]: time="2022-01-28T00:18:07.299845838+05:30" level=info msg="Daemon has >
Jan 28 00:18:07 linuxhelp systemd[1]: Started Docker Application Container Engine.
Jan 28 00:18:07 linuxhelp dockerd[26100]: time="2022-01-28T00:18:07.386143734+05:30" level=info msg="API listen >
Step 9: Download and Run the Docker image from Online Docker Library by using the below command
[root@linuxhelp ~]# docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
2db29710123e: Pull complete
Digest: sha256:507ecde44b8eb741278274653120c2bf793b174c06ff4eaa672b713b3263477b
Status: Downloaded newer image for hello-world:latest
Hello from Docker!
This message shows that your installation appears to be working correctly.
To generate this message, Docker took the following steps:
1. The Docker client contacted the Docker daemon.
2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
(amd64)
3. The Docker daemon created a new container from that image which runs the
executable that produces the output you are currently reading.
4. The Docker daemon streamed that output to the Docker client, which sent it
to your terminal.
To try something more ambitious, you can run an Ubuntu container with:
$ docker run -it ubuntu bash
Share images, automate workflows, and more with a free Docker ID:
https://hub.docker.com/
For more examples and ideas, visit:
https://docs.docker.com/get-started/
With this, the process of installing Docker on Fedora 34 comes to on end
Comments ( 0 )
No comments available