Docker apt-get 更新在构建阶段失败

Docker apt-get update fails during building phase

提问人:Omiros Omiridis 提问时间:9/14/2023 最后编辑:Omiros Omiridis 更新时间:9/14/2023 访问量:467

问:

Dockerfile 第一行

FROM ubuntu:22.10
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update

bash 脚本

cargo clean
docker build -t (name) .

我有一个 Ubuntu 16.04 服务器,其中 rust(以及 cargo)和 docker 已正确安装。但是,当我使用 sudo 执行 bash 脚本时,出现以下错误:

Sending build context to Docker daemon  3.032MB
Step 1/13 : FROM ubuntu:22.10
 ---> 692eb4a905c0
Step 2/13 : ARG DEBIAN_FRONTEND=noninteractive
 ---> Using cache
 ---> 91f5113c2f8f
Step 3/13 : RUN apt-get update
 ---> Running in 4af7c0d85fd7
Ign:1 http://security.ubuntu.com/ubuntu kinetic-security InRelease
Ign:2 http://archive.ubuntu.com/ubuntu kinetic InRelease
Ign:3 http://archive.ubuntu.com/ubuntu kinetic-updates InRelease
Err:4 http://security.ubuntu.com/ubuntu kinetic-security Release
  404  Not Found [IP: 185.125.190.36 80]
Ign:5 http://archive.ubuntu.com/ubuntu kinetic-backports InRelease
Err:6 http://archive.ubuntu.com/ubuntu kinetic Release
  404  Not Found [IP: 185.125.190.39 80]
Err:7 http://archive.ubuntu.com/ubuntu kinetic-updates Release
  404  Not Found [IP: 185.125.190.39 80]
Err:8 http://archive.ubuntu.com/ubuntu kinetic-backports Release
  404  Not Found [IP: 185.125.190.39 80]
Reading package lists...
E: The repository 'http://security.ubuntu.com/ubuntu kinetic-security Release' does not have a Release file.
E: The repository 'http://archive.ubuntu.com/ubuntu kinetic Release' does not have a Release file.
E: The repository 'http://archive.ubuntu.com/ubuntu kinetic-updates Release' does not have a Release file.
E: The repository 'http://archive.ubuntu.com/ubuntu kinetic-backports Release' does not have a Release file.
The command '/bin/sh -c apt-get update' returned a non-zero code: 100
Unable to find image 'marshal:latest' locally
docker: Error response from daemon: pull access denied for marshal, repository does not exist or may require 'docker login': denied: requested access to the resource is denied.
See 'docker run --help'.

我尝试过用各种方式(apt、snap 等)卸载和重新安装 Docker,我尝试过 docker 系统修剪、更改源代码列表、创建新服务器并重新开始等,但问题仍然存在。

ChatGPT 告诉我 kinetic (Ubuntu 22.10) 存在问题,但没有为我提供任何解决问题的帮助。

docker docker文件 ubuntu-16.04

评论


答:

3赞 jsxqf 9/14/2023 #1

我认为这是因为 Ubuntu 22.10 已于 2023 年 7 月 20 日结束使用

最好使用 LTS 版本。例如 Ubuntu 22.04