Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the method of installing Docker in CentOS 8

2025-04-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly explains "what is the method of installing Docker in CentOS 8". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "what is the method of installing Docker in CentOS 8"?

1. Load the previous version of yum remove docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotatedokcer-logrotate docker-engin

Royal docker-ce (ce stands for community version)

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

Delete docker resources

Rm-rf / var/lib/docker2, install dependency package yum install-y yum-utils3, setup mirror repository (default is foreign repository, download is very slow) yum-config-manager-add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo4, update yumyum makecache5, install dockeryum install docker-ce docker-ce-cli containerd.io

If you do not want to install the latest version of docker, but want to install the specified version, 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- docker-ce-cli- containerd.io

For example, install version 18.09.1:

Sudo yum install docker-ce-18.09.1 docker-ce-cli-18.09.1 containerd.io6, start dockersudo systemctl start docker

Check to see if the startup is successful

Docker version7, boot dockersystemctl enable docker8 automatically, run 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 Ali Cloud console, and then assign an image accelerator address [https://qiby9901.mirror.aliyuncs.com].

If you do not apply for an Ali Cloud Image Accelerator, do not configure the daemon.json file. The accelerator can only be accessed in the private network of the Ali Cloud server.

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

Sudo mkdir-p / etc/dockersudo tee / etc/docker/daemon.json

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report