Skip to content

How To Blog

  • 4 Different Ways to Test your Internet Speed How-To
  • How to Customize the Ribbon in MS Office Office Tips
  • Six Copyscape Alternatives That you can use How-To
  • The 7 Best Software Versions of Solitaire For Windows 10 Windows 10
  • Best ti 30 xs multiview calculator 2020

    Best ti 30 xs multiview calculator 2020

  • 9 Best OpenOffice Extensions You Should Install Now Software Reviews
  • Best Brainstorming Apps for Mobile, PC, and Mac Software Reviews
  • Windows Server 2008 Password Complexity Requirements Windows

How to Install and Setup Docker on Centos 8 Quickstart

Posted on May 16, 2023May 16, 2023 By blog_786 No Comments on How to Install and Setup Docker on Centos 8 Quickstart

How to Install and Setup Docker on Centos 8 Quickstart.

Deploying applications can sometimes create unexpected problems for developers. While your code may work just fine in one environment, the same code may not work as expected, or may not work at all in a different computing environment.

The 5 Top Linux Distros You Should Be Using

This difference in computing environments is always a bottleneck for software development and testing. You can of course use a virtual machine as a test environment.

How to Install and Setup Docker on Centos 8 Quickstart

However, virtual machines often take up a lot of space and use up CPU and memory resources on the host system. Fortunately, with Docker, developers can easily develop and deploy their applications in containers. In this guide, we’ll show you how to install Docker on CentOS 8.

So, What is Docker?

Docker is an open-source containerization framework that allows developers to package their code or applications inside containers. Containers are self-contained instances that come with their own libraries and dependencies.

This will take care of any missing libraries or dependency issues during installation when the application is running on different platforms. Compared to running VMs, Docker is lightweight, takes up less hard disk space, is economical in resources, and has better performance and efficiency.

Installing Docker on CentOS 8

To install Docker on your system, make sure you have the following before proceeding:

When everything is clear, follow the instructions to install Docker on CentOS.

Step 1. Update your system

First, log into the server and update the system as follows:

$ sudo dnf update

How to Install and Setup Docker on Centos 8 Quickstart

When prompted to proceed with the installation, simply press “Y” and press the ENTER key on your keyboard. The system will update all packages with newer versions, including kernel, systemd, and other application packages.

This may take several minutes depending on when your system was last updated. So, wait for the system to update the packages.

Step 2.

Add the Docker repository

After completing the upgrade, you need to add the Docker repository to the system. This way you will be able to install Docker using the DFN package manager.

To add a repository, run the following command in a terminal:

[user @ centos8 ~] $ sudo dnf config-manager –add-repo = https: //download.docker.com/linux/centos/docker-ce.repo

You should get simple output confirming the repo has been added.

How to Install and Setup Docker on Centos 8 Quickstart

Once the Docker repository has been created, it is worth taking a look at the available Docker versions. You can do this by entering the command:

[user @ centos8 ~] $ sudo dnf list docker-ce

How to Install and Setup Docker on Centos 8 Quickstart

The output shows the Docker package name, architecture, and version, as well as some of them, as you can see in the output.

Configure NGINX Reverse Proxy – Step by Step

Step 3:

Install Docker-CE

Next, we’re going to install Docker-CE, which is short for Docker Community Edition. Disclaimer: The latest version of Docker is usually not available for all repositories. Therefore, we will add the –nobest flag to the command as follows:

[user @ centos8 ~] $ sudo dnf install docker-ce –nobest

The –nobest flag allows us to set the most preferred option for our server instance. As before, press “Y” and press “Next” to continue.

How to Install and Setup Docker on Centos 8 Quickstart

Once the installation is complete, confirm the Docker version on the command line as shown.

$ docker –version

How to Install and Setup Docker on Centos 8 Quickstart

To run docker commands as sudo user add the user to docker groups as shown.

$ sudo usermod -aG docker $ USER

Restart your system for this to take effect.

Step 4: Manage the Docker Service

Docker works like a daemon, as do services like SSH. This means that you can perform tasks such as checking its status, starting and stopping, and so on, to mention a few.

Docker is currently inactive and down. To start the Docker service, run:

$ sudo systemctl start docker

Check if Docker is running by calling:

State docker $ sudo systemctl

The output confirms that Docker is up and running.

How to Install and Setup Docker on Centos 8 Quickstart

Also, you can allow docker to run every time you boot or reboot as follows.

$ sudo systemctl enable docker

Similarly, you can disable Docker like this:

$ sudo systemctl disable docker

Step 5. Using Docker to Perform Docker Tasks

As we explained earlier in the introduction, Docker is a containerization framework that manages container images, which are isolated units with their own libraries, dependencies, and configuration files. You can build your own container image, or get one from the Docker Hub, which is a huge repository filled with thousands of images from major vendors.

First, we’ll run a simulation to test if Docker is working as expected. To do this, we will retrieve the ‘Hello world’ image from the Docker hub as shown.

$ docker run hello-world

You should get the result below as the container prints the message “Hello from Docker!”

How to Install and Setup Docker on Centos 8 Quickstart

As you can see from the output, Docker simply pulled the hello-world image from the Docker hub, created the container image, and launched the container, which then sent a “Hello from Docker!” Message to the terminal.

To pull only the docker image without starting the container, use the syntax:

$ docker pull image-name

For example, let’s try to get an image of the Apache web server.

$ docker pull httpd

How to Install and Setup Docker on Centos 8 Quickstart

To confirm that the docker images are on the system, issue the command:

$ docker images

How to Install and Setup Docker on Centos 8 Quickstart

In the output, we have 2 images: a hello-world image and an httpd Apache web server image. The output gives you the repository name, image tag, image id, creation time, and image size.

With the image on the system, you can rotate the container by running:

The Most Common Video Formats and Codecs Explained

$ docker run image-name

This launches the container in the foreground. However, this is not always desirable as you will not be able to run other commands. A workaround is to run the image in the background so you can continue running other commands.

To run the container image in the background, use the -d option.

$ docker run -d image-name

For example, to run an Apache container image, run:

$ docker run -d httpd

How to Install and Setup Docker on Centos 8 Quickstart

To check running containers, use the command:

$ docker ps

How to Install and Setup Docker on Centos 8 Quickstart

Again, you will get verbose output about the container, including the container ID, the image the container was created from, creation time and status, and the container name.

When you are done starting the container, you can stop it using the syntax:

$ docker stop CONTAINER-ID

For example, to stop the httpd container, run:

$ docker stop c07ffb3fc13f

How to Install and Setup Docker on Centos 8 Quickstart

You can verify that the container is stopped using the docker ps command as explained earlier.

$ docker ps

How to Install and Setup Docker on Centos 8 Quickstart

In addition, you can add the -a flag to view all containers – running or stopped.

$ docker ps -a

How to Install and Setup Docker on Centos 8 Quickstart

To delete an image, you must first stop the container as shown earlier. After stopping, use the below syntax to remove the image.

$ docker rmi -f REPOSITORY NAME or IMAGE ID

For example, to remove the hello-world image, pause the image as follows.

$ docker stop 043df63a1b29

Then delete the image as follows.

$ docker rmi -f hello world

How to Install and Setup Docker on Centos 8 Quickstart

There are many docker teams out there, but we decided to give you a general idea of ​​what you can achieve with docker and docker images.

Conclusion

While Docker has been deprecated in favor of podman and buildah, which are containerization tools, it is still widely used by developers and newbies looking to get started with containerization. Hopefully, you can now easily install Docker and run Docker commands.

How to Install and Setup Docker on Centos 8 Quickstart

    1. Ready CentOS 8. Instance
    2. SSH access to the server with a configured sudo user.
    3. Stable and reliable internet connection.

  1. How to Install and Setup Docker on Centos 8 Quickstart

Configure CentOS to Sync with NTP Time Servers

How-To Tags:Add the Docker repository, CentOS, Conclusion, Docker, How to Install and Setup Docker on Centos Quickstart, How to Install and Setup Docker on Centos 8 Quickstart, Install, Install Docker CE, Installing Docker on CentOS, Quickstart, Setup, So, What is Docker?

Post navigation

Previous Post: How to Setup Amazon SNS 2021
Next Post: How to Install and Run Flatpak Applications 2021

Related Posts

  • Make a Web App Run Like a Desktop App How-To
  • 8 of the Best Tech Ideas to Cope with Self Isolation How-To
  • Apple’s Self-Screening Tool for Corona Virus How-To
  • How To Remove Viruses Before Your Operating System Starts How-To
  • Best Ways To Play Games Smoothly On An Old PC How-To
  • How to Find Out What DNS Server Am I Using? How-To

Leave a Reply Cancel reply

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

Archives

  • June 2023
  • May 2023
  • April 2023
  • November 2022
  • September 2022
  • August 2022
  • July 2022
  • June 2022
  • May 2022
  • April 2022
  • March 2022
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021
  • August 2021
  • March 2021
  • November 2020
  • October 2020
  • September 2020
  • August 2020
  • July 2020
  • June 2020
  • May 2020
  • April 2020
  • March 2020
  • December 2019
  • July 2019
  • May 2019
  • April 2019
  • January 2019
  • December 2018
  • November 2018
  • October 2018
  • September 2018
  • August 2018

Categories

  • Amazon Web Services
  • Apple Watch
  • Computer Tips
  • Cool Websites
  • Featured Posts
  • Free Software Downloads
  • Gadgets
  • Gaming
  • General Software
  • Google Software/Tips
  • Hardware
  • Help Desk
  • How-To
  • iOS
  • iPad
  • iPhone
  • Linux
  • Linux Tips
  • macOS
  • MS Office Tips
  • Networking
  • Office Tips
  • OS X
  • Product Reviews
  • Reviews
  • Safari
  • Smart Home
  • Smartphones
  • Software Reviews
  • technology
  • text
  • Tools Review
  • Troubleshooting
  • Tutorials
  • Uncategorized
  • Urdu Books PDF
  • Web Site Tips
  • Windows
  • Windows 10
  • Windows 7
  • Windows XP Tips
  • Wordpress

Recent Posts

  • Can I change the file type in Windows 10?
  • How to create line graphs in Google Sheets
  • Best Ways to Create Your Own 3d Printed Lithophanes?
  • Top 5 3D Modeling Apps for iPad Pro
  • How to Fix the “This site can’t be reached” Error in Google Chrome

Recent Comments

  1. How to reset Windows 10 from factory settings - How To Blog on The Easiest Way to Clean Install Windows 10
  2. How to reset Windows 10 from factory settings - How To Blog on 7 Best Programs to Immediately Install on Your New Computer
  3. How to reset Windows 10 from factory settings - How To Blog on What To Do If You Think Your Computer Or Server Has Been Infected With Malware
  4. 9 Best Ways to Fixing Safari Not Working on Mac? - How To Blog on How To Hard Reset a Mac OS X Computer & Reinstall The OS
  5. How to uninstall Avast antivirus on Mac - How To Blog on 4 Ways To Uninstall Apps On Mac
  • Adjust iOS Interaction Accessibility Settings On iOS iOS
  • Best ti34 multiview calculator 2020

    Best ti34 multiview calculator 2020

  • How to Use Firefox Addons Computer Tips
  • How to Open Password Protected RAR Files Software Reviews
  • How to Tell if a Folder is Shared in Windows 10 Windows 10
  • 6 Best Mechanical Keyboards Under $100 Product Reviews
  • How to Filter Data in Excel MS Office Tips
  • How to Use Universal Control Across Macs and iPads Tutorials

Copyright © 2023 How To Blog.

Powered by PressBook News WordPress theme

Go to mobile version