First, the basic environment

1. Operating system: CentOS 7.3

Docker version: 18.06.1
3, the official download address: download.docker.com/linux/stati… (can’t open may need science) online baidu cloud Docker 18.06.1 address: pan.baidu.com/s/1YdN9z72Q… Password: DVVH

4, the official reference documentation: docs.docker.com/install/lin…



Docker installation

Decompress tar -xvf docker-18.06.1-ce.tgz

2. Move the decompressed docker file to the /usr/bin/ directory

 cp docker/* /usr/bin/ Copy the code

3, the docker registered as service vim/etc/systemd/system/docker. The service content is as follows: [Unit] Description=Docker Application Container Engine Documentation=docs.docker.com After=network-online.target firewalld.service Wants=network-online.target

[Service] Type=notify 
# the default is not to use systemd for cgroups because the delegate issues still 
# exists and systemd currently does not support the cgroup feature set required 
# for containers run by docker ExecStart=/usr/bin/dockerd ExecReload=/bin/kill -s HUP $MAINPID 
# Having non-zero Limit*s causes performance problems due to accounting overhead 
# in the kernel. We recommend using cgroups to do container-local accounting. LimitNOFILE=infinity LimitNPROC=infinity LimitCORE=infinity 
# Uncomment TasksMax if your systemd version supports it. # Only systemd 226 and above support this version. 
# TasksMax=infinity TimeoutStartSec=0 # set delegate yes so that systemd does not reset the cgroups of docker containers Delegate=yes 
# kill only the docker process, not all processes in the cgroup KillMode=process 
# restart the docker process if it exits prematurely Restart=on-failure StartLimitBurst=3 StartLimitInterval=60s [Install] WantedBy=multi-user.targetCopy the code



4, start the chmod + x/etc/systemd/system/docker. Service # add file permissions and start the docker systemctl daemon – reload systemctl start docker Docker systemctl enable docker.service
Verify systemctl status docker

# check Docker status Docker -v

Docker run helloworld Docker run helloworld

If the hello-world image is not already available locally, it will be downloaded and started automatically