Links: https://pan.baidu.com/s/1DLOQZ5lTC7KL7OYGQt7iFQ extraction code: j52o
Title I, basic environment
1, the operating system: CentOS 7.3
2, Docker Version: 18.06.1 official Download (open access science may be required)
3, Baidu cloud Docker 18.06.1 Address: https://pan.baidu.com/s/1YdN9z72QutPkHBfLq06H1A Password: dvvh
4, the official reference documentation: https://docs.docker.com/install/linux/docker-ce/binaries/#install-static-binaries
Title II, Docker install the offline installation
-
1, extract the
tar -xvf docker-18.06.1-ce.tgz -
2, the extract from the docker file contents move to the / usr / bin / directory
cp docker / * / usr / bin / -
3, will be registered as a docker-Service
Vim /etc/systemd/system/docker.service
the following configurations applied and saved docker.service
[Unit]
Description=Docker Application Container Engine
Documentation=https://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.target
-
4, start
chmod + x /etc/systemd/system/docker.service # Adding file permissions and start Docker
systemctl daemon-heavy-duty unit # reload the configuration file
systemctl start docker # start Docker
systemctl enable docker.service # Set the boot from Kai -
5. Verify
systemctl status docker # View Docker state
docker -v # View Docker version
Title 3, online Docker installation
With Centos7.x version installed docker
(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
Set ustc mirror image (abnormal start, also check whether the setting is successful)
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
edit the file:
VI /etc/docker/daemon.json
enter the following in the file:
{ "registry-mirrors": ["https://docker.mirrors.ustc.edu.cn"] }
docker registry address default settings
{ "registry-mirrors": ["https://registry.docker-cn.com"] }
Title IV, unloading Docker
1. Query installed package
yum List Installed | grep Docker
Docker-engine.x86_64 17.03.0.ce-1.el7.centos @dockerrepo
2. Remove the installed package
yum -y remove docker-engine.x86_64
3. remove the mirror / containers
rm -rf / var / lib / docker
If three ways installation package download installation packages:
Docker-CE-17.03.2.ce-1.el7.centos.x86_64.rpm
Docker-CE-SELinux-17.03.2.ce-1.el7.centos.noarch .rpm
libtool-ltdl-2.4.2-22.el7_3.x86_64.rpm (non-essential)
offline installation
installed offline
Reference link] ( https://blog.csdn.net/h363659487/article/details/77159306 )
Reference
- For Job for docker.service failed. See 'systemctl status docker.service' and 'journalctl -xn' for details. Error
Error Reference
Error Reference