Docker 无法添加存储库 Universe

Docker failing to add repository Universe

我正在尝试将 universe 添加为我的 docker 图像中的存储库:

RUN add-apt-repository "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) universe"

RUN apt-get update

此输出出错:

Step 4/24 : RUN add-apt-repository "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) universe"
 ---> Running in 4c924d1455ed
Removing intermediate container 4c924d1455ed
 ---> b472a493f90c
Step 5/24 : RUN apt-get update
 ---> Running in d4e292c43bad
Ign:1 http://deb.debian.org/debian stretch InRelease
Hit:2 http://security.debian.org/debian-security stretch/updates InRelease
Hit:3 http://deb.debian.org/debian stretch-updates InRelease
Hit:4 http://deb.debian.org/debian stretch Release
Ign:5 http://archive.ubuntu.com/ubuntu stretch InRelease
Ign:6 http://archive.ubuntu.com/ubuntu stretch Release
Ign:8 http://archive.ubuntu.com/ubuntu stretch/universe all Packages
Ign:9 http://archive.ubuntu.com/ubuntu stretch/universe amd64 Packages
Ign:8 http://archive.ubuntu.com/ubuntu stretch/universe all Packages
Ign:9 http://archive.ubuntu.com/ubuntu stretch/universe amd64 Packages
Ign:8 http://archive.ubuntu.com/ubuntu stretch/universe all Packages
Ign:9 http://archive.ubuntu.com/ubuntu stretch/universe amd64 Packages
Ign:8 http://archive.ubuntu.com/ubuntu stretch/universe all Packages
Ign:9 http://archive.ubuntu.com/ubuntu stretch/universe amd64 Packages
Ign:8 http://archive.ubuntu.com/ubuntu stretch/universe all Packages
Ign:9 http://archive.ubuntu.com/ubuntu stretch/universe amd64 Packages
Ign:8 http://archive.ubuntu.com/ubuntu stretch/universe all Packages
Err:9 http://archive.ubuntu.com/ubuntu stretch/universe amd64 Packages
  404  Not Found [IP: 91.189.88.142 80]
Reading package lists...
W: The repository 'http://archive.ubuntu.com/ubuntu stretch Release' does not have a Release file.
E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/stretch/universe/binary-amd64/Packages  404  Not Found [IP: 91.189.88.142 80]
E: Some index files failed to download. They have been ignored, or old ones used instead.
ERROR: Service 'api' failed to build: The command '/bin/sh -c apt-get update' returned a non-zero code: 100

我的 Docker 文件使用 FROM python:2.7-slim 作为基础。

我做错了什么?


cat /etc/os-release的结果:

PRETTY_NAME="Debian GNU/Linux 9 (stretch)"
NAME="Debian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

由于您使用 debian 作为基础 OS 图像,因此您无法添加 ubuntu 的存储库,如评论中 所述。