具体可以查看Docker官网,我是在服务器上面操作
1,sudo apt-get install -y apt-transport-https ca-certificates curl software-properties-common
2,curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
3. sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
4,sudo apt-get install -y docker-ce
5,查看下咱们下载可用的docker版本
apt-cache madison docker-ce
6,选择你要安装的版本sudo apt-get install docker-ce=<VERSION>
7,查看docker服务是否启动:systemctl status docker
若未启动,则启动docker服务:
sudo systemctl start docker
8.测试下