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

Jenkins builds Docker images and pushes them to Harbor warehouse

Table of contents Dockerfile pom.xml Jenkins Conf...

How does Vue implement communication between components?

Table of contents 1. Communication between father...

How to implement a password strength detector in react

Table of contents Preface use Component Writing D...

Summary of MySQL LOAD_FILE() function method

In MySQL, the LOAD_FILE() function reads a file a...

Native JS to implement the aircraft war game

This article example shares the specific code of ...

4 ways to optimize MySQL queries for millions of data

Table of contents 1. The reason why the limit is ...

Implementation of whack-a-mole game in JavaScript

This article shares the specific code for JavaScr...

Win10 installation Linux system tutorial diagram

To install a virtual machine on a Windows system,...

MySQL database case sensitivity issue

In MySQL, databases correspond to directories wit...

Detailed explanation of MySQL user and permission management

This article uses examples to describe the manage...

Detailed tutorial on installing MySQL 5.7.20 on RedHat 6.5/CentOS 6.5

Download the rpm installation package MySQL offic...

Boundary and range description of between in mysql

mysql between boundary range The range of between...

The difference between html form submission action and url jump to actiond

The action of the form is different from the URL j...

Tutorial for installing MySQL 8.0.18 under Windows (Community Edition)

This article briefly introduces how to install My...