知识点1: CentOS7系统安装Docker
知识点2: Ubuntu18.04系统安装Docker
apt-get remove docker docker-engine docker.io containerd runcapt-get update#添加使用 https 传输的软件包和 CA证书apt-get install apt-transport-https ca-certificates curl software-properties-common -y#添加软件源的GPG密钥curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -#添加docker软件源add-apt-repository \"deb [arch=amd64] https://download.docker.com/linux/ubuntu \$(lsb_release -cs) \stable"#安装docker-ceapt-get install docker-ce docker-ce-cli containerd.io -y#查找Docker-CE的版本apt-cache madison docker-ce#安装指定版本的Docker-CE,比如要安装19.03.8~3-0~ubuntu-bionicapt-get -y install docker-ce=19.03.8~3-0~ubuntu-bionic#创建daemon.json配置文件root@node01:~# cat /etc/docker/daemon.json{"registry-mirrors": ["https://dockerhub.mirrors.nwafu.edu.cn/"]}#加载配置,重启docker服务root@node01:~# systemctl daemon-reloadroot@node01:~# systemctl start dockerroot@node01:~# systemctl status docker● docker.service - Docker Application Container EngineLoaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)Active: active (running) since Fri 2021-03-12 10:12:25 CST; 4h 27min agoDocs: https://docs.docker.comMain PID: 8774 (dockerd)Tasks: 9CGroup: /system.slice/docker.service└─8774 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
