linux - Dockerfile 中的 apt-get update 失败
问题描述
当我尝试构建一个简单的 docker 映像时:
在 Dockerfile 中:
FROM ubuntu:18.04
RUN apt-get update
输出是:
$ sudo docker build --no-cache -t testbuild .
Sending build context to Docker daemon 3.471MB
Step 1/2 : FROM ubuntu:18.04
---> c090eaba6b94
Step 2/2 : RUN apt-get update
---> Running in 53d64603442f
Ign:1 http://archive.ubuntu.com/ubuntu bionic InRelease
Ign:2 http://security.ubuntu.com/ubuntu bionic-security InRelease
Ign:3 http://archive.ubuntu.com/ubuntu bionic-updates InRelease
Err:4 http://security.ubuntu.com/ubuntu bionic-security Release
404 Not Found [IP: 91.189.88.142 80]
Ign:5 http://archive.ubuntu.com/ubuntu bionic-backports InRelease
Err:6 http://archive.ubuntu.com/ubuntu bionic Release
404 Not Found [IP: 91.189.88.152 80]
Err:7 http://archive.ubuntu.com/ubuntu bionic-updates Release
404 Not Found [IP: 91.189.88.152 80]
Err:8 http://archive.ubuntu.com/ubuntu bionic-backports Release
404 Not Found [IP: 91.189.88.152 80]
Reading package lists...
E: The repository 'http://security.ubuntu.com/ubuntu bionic-security Release' does not have a Release file.
E: The repository 'http://archive.ubuntu.com/ubuntu bionic Release' does not have a Release file.
E: The repository 'http://archive.ubuntu.com/ubuntu bionic-updates Release' does not have a Release file.
E: The repository 'http://archive.ubuntu.com/ubuntu bionic-backports Release' does not have a Release file.
The command '/bin/sh -c apt-get update' returned a non-zero code: 100
我试过了:
使用不同类型的 ubuntu 映像构建 - 例如 ubuntu:16.04、18.04、20.04 - 并得到类似的错误“...Release”没有发布文件。
我从我的系统中完全删除并重新安装了 docker,包括所有容器和存储库,然后重新启动,并得到相同的错误
我之前构建了多个 docker 镜像,一切正常。而现在我总是莫名其妙地得到这个错误。
解决方案
推荐阅读
- bash - 您如何为 aws cloudformation deploy --parameter-overrides 和/或 --tags 添加空间?
- php - laravel 获取帖子列表,包括他们的标签和评论
- sql - Oracle 18c - PL/SQL 限制写入文件的记录
- python-3.x - tkinter 照片图像错误:pyimage1 不存在
- maven - Gitlab跨项目神器
- teradata - Teradata 中止会话,使 DBA 晚上睡得更好
- c++ - 压缩天然气。AES。错误解密(可能加密)的文件
- python - Sympy - 仅在特定位置找到矩阵的逆?
- regex - 重命名命令 Debian 服务器
- javascript - 将关联数组作为循环列表浏览