0%

Ubuntu安装旧版本Docker

mark

目前此操作方法不支持Ubuntu18.04

第一步:添加源

1
2
3
4
5
6
7
8
9
10
11
12
13
# 下面这个Docker的源
deb https://apt.dockerproject.org/repo ubuntu-xenial main

deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse

版本对应关系如下:

mark

所以在写的时候这样写就好了

Precise 12.04 (LTS) deb https://apt.dockerproject.org/repo ubuntu-precise main

Trusty 14.04 (LTS) deb https://apt.dockerproject.org/repo ubuntu-trusty main

Wily 15.10 deb https://apt.dockerproject.org/repo ubuntu-wily main

Xenial 16.04 (LTS) deb https://apt.dockerproject.org/repo ubuntu-xenial main

第二步:添加秘钥

1
apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D

第三步:apt更新

1
apt-get update

第四步:查看可选的Docker版本

1
apt-cache policy docker-engine

mark

第五步:安装想要的版本的Docker

1
apt install docker-engine=1.11.2-0~xenial

在这个网站查看支持的版本https://apt.dockerproject.org/repo/dists/

  • 本文作者: Tim
  • 本文链接: https://zouchanglin.cn/419815303.html
  • 版权声明: 本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!