3.Docker installation and startup

3 Docker Installation and Start

3.1 Installation Docker

Docker official recommended to install in Ubuntu, because Docker is based on Ubuntu release, but problems arise general Docker Ubuntu is the first update or patch. In many versions of CentOS is not supported by some of the latest patch update package.

Since we are using the learning environment is CentOS, so here we will Docker installed on CentOS. Note: It is recommended to install at least CentOS7.x version, in CentOS6.x version, you need to install before installing a lot of other environmental and Docker many patches do not support updates.

Please direct mount curriculum supporting Centos7.x mirror

(1) yum update to the latest package

sudo yum update

 

(2) require installation package, yum-util provide yum-config-manager function, the other two are driven dependent devicemapper

sudo yum install -y yum-utils device-mapper-persistent-data lvm2

  

(3) Set yum source cloud Ali

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

 

(4) mounted docker

 sudo yum install docker-ce

   

(5) After installing the version View docker

 docker -v

  

3.2 Set mirror ustc

ustc is a veteran of linux mirror service provider, and as far in ubuntu 5.04 version when in use. docker Mirror accelerator speed ustc quickly. One of the advantages ustc docker mirror is no need to register, is a real public service.

[https://lug.ustc.edu.cn/wiki/mirrors/help/docker](https://lug.ustc.edu.cn/wiki/mirrors/help/docker)

Edit the file:

we /etc/docker/daemon.json  

   

Enter the following in the file:

{
"registry-mirrors": ["https://docker.mirrors.ustc.edu.cn"]
}

  



## 2.3 Docker start and stop

** systemctl ** command is a system service manager command

Start docker:

 systemctl start docker

 

Stop docker:

systemctl stop docker

  

Restart docker:

systemctl restart docker

  

View docker Status:

systemctl status docker

 

boot:

systemctl enable docker

 

View docker summary information

docker info

 

View docker help documentation

docker --help

  



Guess you like

Origin www.cnblogs.com/sdrbg/p/11310696.html