Thursday, 29 August 2024

Install Docker on RHEL9.4

Source:https://gopesh3652.medium.com/installing-docker-in-rhel-9-locally-by-configuring-yum-42bdfea103f0 Introduction Docker is a popular containerization platform that simplifies the process of building, distributing, and running applications inside containers. Red Hat Enterprise Linux (RHEL) 9 is a stable and reliable operating system widely used in production environments. In this guide, we’ll walk you through the step-by-step process of installing Docker on RHEL 9 by configuring the YUM package manager. Prerequisites Before proceeding with the installation, ensure you have the following: A machine running Red Hat Enterprise Linux 9. Administrative access to the system. An active internet connection. Step 1: Update the System The first step is to ensure your system is up-to-date. Open a terminal and execute the following command: sudo yum update Step 2: Add Docker Repository to YUM To install Docker on RHEL 9, you’ll need to add the Docker repository to the YUM configuration. Create a new file named “docker.repo” in the “/etc/yum.repos.d/” directory using a text editor like vi or nano: sudo vi /etc/yum.repos.d/docker.repo Add the following lines to the file: [docker-ce-stable] name=Docker CE Stable - $basearch baseurl=https://download.docker.com/linux/rhel/9/$basearch/stable enabled=1 gpgcheck=1 gpgkey=https://download.docker.com/linux/rhel/gpg Save the file and exit the text editor. Step 3: Install Docker Now that you’ve added the Docker repository, you can install Docker using the YUM package manager: sudo yum install docker-ce --nobest Step 4: Start and Enable Docker After the installation is complete, start the Docker service and enable it to start on boot: sudo systemctl start docker sudo systemctl enable docker Step 5: Verify Docker Installation To verify that Docker is installed correctly, run the following command: docker --version This command will display the installed Docker version, confirming that the installation was successful. Step 6: Test Docker with a Simple Container To ensure Docker is functioning properly, test it with a simple container: sudo docker run hello-world Docker will download the “hello-world” image and run a container from it. If everything is set up correctly, you’ll see a message indicating a successful installation Remember that Docker requires root privileges to run, so use the “sudo” command when interacting with Docker unless you’ve granted your user non-root access to Docker.

No comments:

Post a Comment