How to set up Docker on Fedora 38 via the terminal emulator?

Photo by Ian Taylor on Unsplash

How to set up Docker on Fedora 38 via the terminal emulator?


Docker

Docker is a platform for developing, shipping, and running applications in containers.

Containers are lightweight, portable, and self-sufficient units that can package an application and its dependencies, including libraries and configuration files, into a single, consistent environment.

This allows developers to create, deploy, and manage applications more efficiently, regardless of the underlying infrastructure.


Let's get down to business

shall we?

The-office GIFs - Get the best GIF on GIPHY


Solution


Check your OS (optional)

This step is just to ensure you have Fedora 38 Linux installed. You can pick up one command or you can use them all.

/etc/os-release

cat /etc/os-release


hostnamectl

hostnamectl

Output

When you run hostnamectl without any options, it provides detailed information about the system's hostname, operating system, kernel, and other system-related settings.


lsb_release

lsb_release -a

Output

lsb_release is a command-line utility commonly found in Linux distributions that adhere to the Linux Standard Base (LSB). The LSB is a standardization initiative that aims to increase compatibility between different Linux distributions by defining a common set of libraries and conventions.


uname

uname -a

Output

The uname -a command is used to display detailed system information about the Linux operating system. It provides information about the system's kernel and other system-related details.


Install dependencies

sudo dnf -y install dnf-plugins-core

Add a YUM repo for Docker

sudo dnf config-manager --add-repo https://download.docker.com/linux/fedora/docker-ce.repo

Your output should look something like the following:

[elitebughunter@192 ~]$ sudo dnf config-manager --add-repo https://download.docker.com/linux/fedora/docker-ce.repo
Adding repo from: https://download.docker.com/linux/fedora/docker-ce.repo
[elitebughunter@192 ~]$

Brief explanation

config-manager: This is a DNF subcommand used for managing repository configurations.

--add-repo: This flag indicates that you want to add a new repository to the system.

https://download.docker.com/linux/fedora/docker-ce.repo: This is the URL of the Docker repository configuration file. By adding this repository, you make Docker-related packages and updates available for installation and management through DNF on your Fedora system.


Check repo

sudo dnf repolist
sudo dnf repolist | grep docker

Output


Install Docker Engine, containerd, and Docker Compose

sudo dnf install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

Output


Check installation

docker --version
which docker
docker --help

Your output should look something like the following:


Check Docker status

sudo systemctl status docker

Output

The command is used to manage and control system services on Linux systems that use systemd as their init system is systemctl.

systemd is a system and service manager commonly used in modern Linux distributions.


Start Docker

sudo systemctl start docker

Check the status

sudo systemctl status docker

Output:


Run Hello-world

sudo docker run hello-world

Output


Done

You have now successfully installed and started Docker Engine.


Celebrate

image.png


Let's become friends


Final thoughts

Thank you for reading this article.

If you have any questions, thoughts, suggestions, or corrections, please share them with us.

We appreciate your feedback and look forward to hearing from you.

Feel free to suggest topics for future blog articles. Until next time!