1.sudo apt update
2.sudo apt install apt-transport-https ca-certificates curl software-properties-common
3.curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
4.sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable"
5.sudo apt update
6.apt-cache policy docker-ce
7.docker-ce
8.sudo apt install docker-ce
如果安装过慢,请尝试
sudo apt-get -y install docker-ce
9.sudo systemctl status docker
10.sudo usermod -a -G docker ${USER}
11.su - ${USER}
12.id -nG
如果以上不好使请尝试
13.sammy sudo docker
14.sudo usermod -aG docker username
15.docker run hello-world