1、使用如下脚本安装docker
[root@localhost ~]# cat install-docker.sh
#! /bin/bash
yum install -y yum-utils device-mapper-persistent-data lvm2
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
yum install -y docker-ce-18.06.2.ce-3.el7
# 设置docker的加速镜像
curl -sSL https://get.daocloud.io/daotools/set_mirror.sh | sh -s http://f1361db2.m.daocloud.io
2、部署完成后检查,出现以下内容说明部署成功
[root@localhost ~]# docker info
Containers: 31
Running: 31
Paused: 0
Stopped: 0
Images: 39
Server Version: 18.06.2-ce
Storage Driver: overlay2
Backing Filesystem: xfs
Supports d_type: true
Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: systemd
Plugins:
Volume: local
Network: bridge host macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 468a545b9edcd5932818eb9de8e72413e616e86e
runc version: 69663f0bd4b60df09991c08812a60108003fa340
init version: fec3683
Security Options:
seccomp
Profile: default
Kernel Version: 3.10.0-693.el7.x86_64
Operating System: CentOS Linux 7 (Core)
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 7.546GiB
Name: node2
ID: VXQZ:X4AX:OF7E:NDAD:MUNB:UZBN:JQ3Q:WZ6R:324K:N6ZS:SHS5:4IBO
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
192.168.122.225:5000
127.0.0.0/8
Registry Mirrors:
http://f1231se2.m.daocloud.io/
Live Restore Enabled: false