Detailed tutorial on installing Docker on CentOS 8

Detailed tutorial on installing Docker on CentOS 8

1. Previous versions

yum remove docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate
dokcer-logrotate docker-engin

Royal docker-ce (ce stands for community edition)

yum remove docker-ce docker-ce-cli containerd.io

Deleting Docker Resources

rm -rf /var/lib/docker

2. Install dependency packages

yum install -y yum-utils

3. Set up the mirror warehouse (the default is the foreign warehouse, which downloads very slowly)

yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

4. Update yum

yum makecache

5. Install Docker

yum install docker-ce docker-ce-cli containerd.io

If you don't want to install the latest version of docker, you can do this:

First find out which versions of docker are available

yum list docker-ce --showduplicates | sort -r

Install the specified version

sudo yum install docker-ce-<version_string> docker-ce-cli-<version_string> containerd.io

For example, to install version 18.09.1:

sudo yum install docker-ce-18.09.1 ​​docker-ce-cli-18.09.1 ​​containerd.io

6. Start Docker

sudo systemctl start docker

Check whether the startup is successful

docker version

7. Automatically start Docker at boot

systemctl enable docker

8. Run the Hellow-world image

sudo docker run hellow-world

Docker version information:

Run hello-world information:

9. Configure Docker Image Accelerator

Apply for a container image service in the Alibaba Cloud console, and then an image accelerator address [https://qiby9901.mirror.aliyuncs.com] will be assigned.

If you have not applied for Alibaba Cloud Image Accelerator, do not configure the daemon.json file. The accelerator can only be accessed in the Alibaba Cloud server intranet.

Create a daemon.json file in the /etc/docker directory.

sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-'EOF'
{
"registry-mirrors": [
"https://qiyb9901.mirror.aliyuncs.com"
]
}
EOF

Save, reload the configuration file and restart Docker

sudo systemctl daemon-reload
sudo systemctl restart docker

10. Install the docker visual interface management tool portainer

docker run -d -p 8090:9000 --restart=always -v /var/run/docker.sock:/var/run/docker.sock --privileged=true
portainer/portainer

Note that the docker container port must be 9000 to start portainer

Enter http://localhost ip:8090 in the browser address bar to access portainer.

The above is a detailed tutorial on how to install Docker on CentOS 8 introduced by the editor. I hope it will be helpful to everyone. I would also like to thank everyone for their support of the 123WORDPRESS.COM website!

You may also be interested in:
  • The most complete steps in installing Oracle19c with Docker
  • Docker basic commands from installation to application deployment and private warehouse construction
  • Install a specific version of Docker for CentOS
  • Centos8 installation docker error (error prompt: All mirrors were tried)
  • How to install Docker on CentOS
  • Docker installation and deployment tutorial under CentOS7.6 system

<<:  How to let https website send referrer https and http jump referrer

>>:  More than 300 lines of CSS code to achieve the explosive special effects of WeChat 8.0

Recommend

MySQL 8.0.12 installation and configuration method graphic tutorial

Record the installation and configuration method ...

Common Linux English Error Chinese Translation (Newbies Must Know)

1.command not found command not found 2. No such ...

Detailed explanation of docker network bidirectional connection

View Docker Network docker network ls [root@maste...

How does MySQL ensure data integrity?

The importance of data consistency and integrity ...

An example of how to implement an adaptive square using CSS

The traditional method is to write a square in a ...

How to use JSZip compression in CocosCreator

CocosCreator version: 2.4.2 Practical project app...

Detailed explanation of the new features of ES9: Async iteration

Table of contents Asynchronous traversal Asynchro...

How to implement web stress testing through Apache Bench

1. Introduction to Apache Bench ApacheBench is a ...

Steps for installing MySQL 8.0.16 on Windows and solutions to errors

1. Introduction: I think the changes after mysql8...

Web front-end skills summary (personal practical experience)

1. Today, when I was making a page, I encountered ...

A brief introduction to MySQL functions

Table of contents 1. Mathematical functions 2. St...

js realizes two-way data binding (accessor monitoring)

This article example shares the specific code of ...

Detailed explanation of Bind mounts for Docker data storage

Before reading this article, I hope you have a pr...

How to pull the docker image to view the version

To view the version and tag of the image, you nee...