如何在Ubuntu 18上安装较旧的Docker版本(18.06.2)?

时间:2019-11-03 20:19:18

标签: docker ubuntu kubernetes installation version

我一直在尝试安装Kubernetes,但是它已经在Docker上开始了。我似乎在Ubuntu上找不到适用于Docker的正确版本。 正如Kubernetes推荐的Docker版本18.06.2一样,我首先按照Kubernetes上的步骤进行操作:Kubernetes installation

出现此错误的地方:

E: Version '18.06.2~ce~3-0~ubuntu' for 'docker-ce' was not found

Docker说要通过此命令列出可用版本的版本:

apt-cache madison docker-ce

哪个能给我这个?

root@vmi257369:~# apt-cache madison docker-ce
 docker-ce | 5:19.03.3~3-0~ubuntu-disco | https://download.docker.com/linux/ubuntu disco/stable amd64 Packages
 docker-ce | 5:19.03.2~3-0~ubuntu-disco | https://download.docker.com/linux/ubuntu disco/stable amd64 Packages
 docker-ce | 5:19.03.1~3-0~ubuntu-disco | https://download.docker.com/linux/ubuntu disco/stable amd64 Packages
 docker-ce | 5:19.03.0~3-0~ubuntu-disco | https://download.docker.com/linux/ubuntu disco/stable amd64 Packages

您可以看到没有18.06,但是只有19,而Kubernetes不建议这样做。

我遵循了Docker Docker installation的指南,但是我似乎找不到正确的GPG或Docker版本18所必需的。

我当然也尝试过Stackoverflow上的帖子see here,结果是:

root@vmi257369:~# export VERSION=18.06.1-ce && curl -sSL get.docker.com | sh
# Executing docker install script, commit: f45d7c11389849ff46a6b4d94e0dd1ffebca32c1
Warning: the "docker" command appears to already exist on this system.

If you already have Docker installed, this script can cause trouble, which is
why we're displaying this warning and provide the opportunity to cancel the
installation.

If you installed the current Docker package using this script and are using it
again to update Docker, you can safely ignore this message.

You may press Ctrl+C now to abort this script.
+ sleep 20
+ sh -c apt-get update -qq >/dev/null
+ sh -c DEBIAN_FRONTEND=noninteractive apt-get install -y -qq apt-transport-https ca-certificates curl >/dev/null
+ sh -c curl -fsSL "https://download.docker.com/linux/ubuntu/gpg" | apt-key add -qq - >/dev/null
Warning: apt-key output should not be parsed (stdout is not a terminal)
+ sh -c echo "deb [arch=amd64] https://download.docker.com/linux/ubuntu disco stable" > /etc/apt/sources.list.d/docker.list
+ sh -c apt-get update -qq >/dev/null
INFO: Searching repository for VERSION '18.06.1-ce'
INFO: apt-cache madison 'docker-ce' | grep '18.06.1.*ce.*-0~ubuntu' | head -1 | awk '{$1=$1};1' | cut -d' ' -f 3

ERROR: '18.06.1-ce' not found amongst apt-cache madison results

谁知道该怎么办?

关于答案 通过此命令

apt-add-repository "deb https://apt.dockerproject.org/repo ubuntu-$(lsb_release -cs) main"

我收到此错误: 无法获取<> 403 IP禁止.... 这是在Contabo服务器上吗?

1 个答案:

答案 0 :(得分:0)

sudo -i
curl -fsSL https://apt.dockerproject.org/gpg | apt-key add -
apt-add-repository "deb https://apt.dockerproject.org/repo ubuntu-$(lsb_release -cs) main"
apt-get update -y && apt-get install docker-ce=18.06.2~ce~3-0~ubuntu

OR

sudo -i
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
apt-get update -y && apt install -y docker-ce=18.06.3~ce~3-0~ubuntu docker-ce-cli=18.06.3~ce~3-0~ubuntu containerd.io