docker - 如何在 Ubuntu 18 上安装较旧的 Docker 版本(18.06.2)?
问题描述
几天来我一直在尝试安装 Kubernetes,但它已经从 Docker 开始了。我似乎在 Ubuntu 上找不到合适的 Docker 版本。由于 Kubernetes 推荐 Docker 18.06.2 版本,我首先按照 Kubernetes 上的步骤进行操作:Kubernetes 安装
当我得到这个错误时:
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,但 Kubernetes 不推荐的只有 19。
我已经按照 Docker Docker 安装指南进行操作,但我似乎找不到正确的 GPG 或 Docker 版本 18 所需的任何东西。
当然,我也尝试过 Stackoverflow 上的帖子,请参见此处,结果是:
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"
我收到此错误:无法在 IP 上获取 <> 403 Forbidden .... 它位于 Contabo 服务器上,也许这就是原因?
解决方案
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
或者
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
推荐阅读
- python - 带参数的类装饰器
- ios - 是什么让临时性 Always 授权是临时性的?
- discord.py - 存储触发功能的消息内容
- r - 记录定义同名函数的包
- database - 更改集合时 MongoDB 游标的行为如何?
- javascript - 当在 twitch 聊天中写入关键字时,向频道发送消息的 Discord 机器人
- r - 使用 R 中的 OECD 包从 OECD 网站下载数据
- javascript - 有没有办法使用 Typescript 使可选的 React 道具类型更清洁?
- python - 调用 Python 脚本的 Powershell 脚本在 ISE 中正常工作,但在任务计划程序中不能正常工作
- sqlite - 有没有办法获得超过 1 个值?