Linux

How to Install Docker on Fedora: A Beginner’s Guide 

1. What is Docker?

Docker is a game-changing technology that revolutionized software development and deployment. Here’s what you need to know:

1.1 Containerization: 

Docker allows you to create isolated environments called containers. An application, along with all its dependencies, libraries, and runtime environment, is packaged within these containers.Think of them as lightweight, self-contained units that can run consistently across different systems.

1.2 Portability: 

It allows you to combine your application, its code, and all the necessary elements into a solitary container. This container can then be moved seamlessly between development, testing, and production environments. No more “it works on my machine” surprises!

1.3 Efficiency: 

Containers share the host OS kernel, which means they consume fewer resources compared to traditional virtual machines (VMs). Docker’s efficiency allows you to run multiple containers on the same host without sacrificing performance.

2. Prerequisites

Double-check that you have the necessary prerequisites before proceeding:

2.1 Fedora Version: 

You need a maintained version of Fedora 38 or Fedora 39.

2.2 Uninstall Old Versions: 

If you have any older versions of Docker (previously known as docker or docker-engine), uninstall them first.

3. Installation Methods

You can install Docker Engine using different methods based on your needs:

3.1 Recommended Approach: Setup Docker’s Repositories

  • This method simplifies installation and upgrades.
  • Start by setting up the Docker repository:

`sudo dnf -y install dnf-plugins-core`

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

  • Install Docker Engine, containerd, and Docker Compose, and make they are the latest versions:

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

  • Should you receive a prompt to accept the GPG key, verify the fingerprint (060A 61C5 1B55 8A7F 742B 77AA C52F EB6B 621E 9F35) prior to accepting it.

3.2 Manual RPM Installation (Air-Gapped Systems)

  • Download the RPM package from the repository and install it manually.
  • Useful for situations where internet access is restricted.
  • To obtain detailed instructions, please consult the official documentation.

3.3 Automated Convenience Scripts (Testing and Development)

  • For testing and development environments, use convenience scripts to install Docker.
  • These scripts automate the installation process.

4. Starting Docker

After installation, Docker is not automatically started. Execute the following commands to manage it:

  • Start Docker: `sudo systemctl start docker`
  • Enable Docker to launch on system startup: `sudo systemctl enable –now docker`

5. Verifying Installation

To verify that Docker is working correctly, run the following command: `docker –version`

6. Common Errors During Installation

6.1 “Unable to find package docker-ce”: 

This error can occur if the Docker repository is not set up properly. Make sure you have added the correct repository URL and try the installation again.

6.2 “Error: Unable to locate package docker-ce-cli”: 

This error can occur if the repository is not set up properly. Make sure you have added the correct repository URL and try the installation again.

6.3 “Dependency resolution failed”: 

This error would appear if there are conflicts with other packages installed on your system. Try resolving the dependencies manually or use the “–skip-broken” option to skip dependency resolution.

6.4 “Error: Transaction check error”: 

This error would appear if there are conflicts with other packages installed on your system. Try resolving the conflicts manually or use the “–skip-broken” option to skip dependency resolution.

7. Conclusion

Docker is great for software development and deployment. It offers containerization, portability, and efficiency. It also ensures consistency across different environments and allows seamless migration between systems. It achieves efficiency through resource-sharing and streamlines workflows, making software development more agile and reliable.

 

For more installation guides, explore www.intogeeks.com

 

 

 

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button