关注IT
关注系统玩家

ubuntu 安装指定版本的docker

实验环境:

1、宿主机系统:Ubuntu16.04

2、docker源:阿里云

1、添加docker源

cat >/etc/apt/sources.list.d/docker-main.list<<EOF
deb [arch=amd64] http://mirrors.aliyun.com/docker-engine/apt/repo ubuntu-xenial main
EOF

2、Add Docker’s official GPG key:

curl -fsSL https://apt.dockerproject.org/gpg | sudo apt-key add -

3、更新源和升级系统

apt-get update && apt-get upgrade -y 

4、卸载旧版本docker

apt-get purge lxc-docker*

5、列出docker版本

apt-cache policy docker-engine

root@node:~# apt-cache policy docker-engine
docker-engine:
Installed: (none)
Candidate: 1.13.1-0~ubuntu-xenial
Version table:
1.13.1-0~ubuntu-xenial 500
500 http://mirrors.aliyun.com/docker-engine/apt/repo ubuntu-xenial/main amd64 Packages
1.13.0-0~ubuntu-xenial 500
500 http://mirrors.aliyun.com/docker-engine/apt/repo ubuntu-xenial/main amd64 Packages
100 /var/lib/dpkg/status
1.12.6-0~ubuntu-xenial 500
500 http://mirrors.aliyun.com/docker-engine/apt/repo ubuntu-xenial/main amd64 Packages
1.12.5-0~ubuntu-xenial 500
500 http://mirrors.aliyun.com/docker-engine/apt/repo ubuntu-xenial/main amd64 Packages
1.12.4-0~ubuntu-xenial 500
500 http://mirrors.aliyun.com/docker-engine/apt/repo ubuntu-xenial/main amd64 Packages
1.12.3-0~xenial 500
500 http://mirrors.aliyun.com/docker-engine/apt/repo ubuntu-xenial/main amd64 Packages
1.12.2-0~xenial 500
500 http://mirrors.aliyun.com/docker-engine/apt/repo ubuntu-xenial/main amd64 Packages
1.12.1-0~xenial 500
500 http://mirrors.aliyun.com/docker-engine/apt/repo ubuntu-xenial/main amd64 Packages
1.12.0-0~xenial 500
500 http://mirrors.aliyun.com/docker-engine/apt/repo ubuntu-xenial/main amd64 Packages
1.11.2-0~xenial 500
500 http://mirrors.aliyun.com/docker-engine/apt/repo ubuntu-xenial/main amd64 Packages
1.11.1-0~xenial 500
500 http://mirrors.aliyun.com/docker-engine/apt/repo ubuntu-xenial/main amd64 Packages
1.11.0-0~xenial 500
500 http://mirrors.aliyun.com/docker-engine/apt/repo ubuntu-xenial/main amd64 Packages
root@node:~#

6、安装指定版本

apt-get install -y docker-engine=xxxxx

 

 

 

分享到:更多 ()
喜欢 1
rancher

评论 抢沙发

评论前必须登录!