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

How to install docker

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

The main content of this article is "how to install docker". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to install docker.

Fancy installation of docker

First of all, the basic requirements before using docker

Now let's start installing docker

Method 1: download and install from the official docker (this method is complex and not recommended)

Click on the download engine

Select our centos (give your operating system choice)

Click on the installation guide

Use it after copying the URL.

Handwritten yum source (already written by the blogger)

Vim / etc/yum.repos.d/docker.repo

[docker]

Name=docker

Baseurl= https://download.docker.com/linux/centos/7/x86_64/stable/Packages/

Gpgcheck=0

Enabled=1

: wq (save exit)

Execute the cache command yum repolist (you will find nothing in our docker repository)

We modify the parameters in the yum source (delete / Packages/)

Re-execute the caching command yum repolist (we will find that our docker repository already has a cache)

We install the latest version of docker testing (testing)

/ / the latest version is downloaded by default. (but the download is very slow, we can also use another way to install docker) (friends who work abroad can try this method)

Method 2: download the docker-ce website on Aliyun in China: Ali Mirror Station

Copy and run the selected command

Check the yum source ls / etc/yum.repos.d/ after installation

Confirm that there is docker-ce in the warehouse

Use docker-ce as cache yum makecache

Check the available version of docker yum list docker-ce.x86_64-- showduplicates | sort-r

Here we download 18.9.0. note that we do not use the method officially recommended by Aliyun. We download the three components docker-ce,docker-ce-cli and containerd.io respectively.

Yum-y install docker-ce-18.09.0-3.el7 docker-ce-cli-18.09.0-3.el7 containerd.io-1.2.0-el7

Open the docker service and add him to boot

Systemctl start docker

Systemctl enable docker

View docker version

Docker-v (view client version only)

Docker version (view details of docker)

If the virtual machine is minimally installed, install the tab auto-completion plug-in (convenient for tab)

Yum-y install bash-completion

Let's download a centos7 image

Docker pull centos:7 (you will find the download is too slow)

It doesn't matter. We can use the nominal accelerator website of docker: Daoke Cloud.

Speed up docker download

Using the docker image accelerator, the daocloud accelerator is used here, and of course there are other accelerators, such as Ali Yun, Tsinghua mirror station and so on.

Curl-sSL https://get.daocloud.io/daotools/set_mirror.sh | sh-s http://f1361db2.m.daocloud.io

Use the background daemon:

Systemctl daemon-reload

Restart docker after that

Systemctl restart docker

Check docker information (you will find Doug Cloud Accelerator)

Docker info

Download the centos7 image again (you will find a fast batch)

At this point, I believe that you have a deeper understanding of "docker installation", might as well come to the actual operation of it! Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

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

Servers

Wechat

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

12
Report