1、安装依赖软件
sudo apt-get update
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common lrzsz -y
2、更新软件源
sudo curl -fsSL https://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get update
3、安装docker
sudo apt-get install docker-ce -y
4、查看版本
docker version
5、加速器
curl -sSL https://get.daocloud.io/daotools/set_mirror.sh | sh -s http://f1361db2.m.daocloud.io
sudo vim /etc/docker/daemon.json
{"registry-mirrors": ["http://f1361db2.m.daocloud.io"], "insecure-registries": []}
systemctl restart docker
6、权限
sudo groupadd docker
sudo gpasswd -a ${USER} docker
systemctl restart docker
newgrp - docker