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

A brief talk about Rx responsive programming

Table of contents 1. Observable 2. Higher-order f...

Linux automatically deletes logs and example commands from n days ago

1. Delete file command: find the corresponding di...

The neglected special effects of META tags (page transition effects)

Using js in web design can achieve many page effec...

How to use Linux to calculate the disk space occupied by timed files

Open the scheduled task editor. Cent uses vim to ...

Analysis of the cause of docker error Exited (1) 4 minutes ago

Docker error 1. Check the cause docker logs nexus...

Solution to inserting a form with a blank line above and below

I don't know if you have noticed when making a...

1 minute Vue implements right-click menu

Table of contents Rendering Install Code Implemen...

How to debug loader plugin in webpack project

Recently, when I was learning how to use webpack,...

Installation and configuration of MySQL 5.7.17 free installation version

MYSQL version: MySQL Community Server 5.7.17, ins...

Detailed explanation of the failure of MySQL to use UNION to connect two queries

Overview UNION The connection data set keyword ca...

On good design

<br />For every ten thousand people who answ...

Detailed explanation of Vue's SSR server-side rendering example

Why use Server-Side Rendering (SSR) Better SEO, s...

MySQL paging query optimization techniques

In applications with paging queries, queries that...