首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在从maven构建dockerfile时未能获取debian amd64包:3.5.2-JDK-8

在从maven构建dockerfile时未能获取debian amd64包:3.5.2-JDK-8
EN

Unix & Linux用户
提问于 2023-04-24 07:22:30
回答 3查看 29.3K关注 0票数 28

Dockerfile:

代码语言:javascript
复制
FROM maven:3.5.2-jdk-8

RUN apt-get update && \
    apt-get install -y python-dev python-pip
RUN pip install awscli --upgrade

构建日志:

代码语言:javascript
复制
Preparing build context archive…
[==================================================>]3380/3380 files
Done

Sending build context to Docker daemon…
[==================================================>] 23.19MB
Done

Step 1/17 : FROM maven:3.5.2-jdk-8
 ---> d07bef19f01a
Step 2/17 : RUN apt-get update &&     apt-get install -y python-dev python-pip
 ---> Running in ebed1b8ce61e
Ign:1 http://security.debian.org stretch/updates InRelease
Ign:2 http://deb.debian.org/debian stretch InRelease
Ign:3 http://security.debian.org stretch/updates Release
Ign:4 http://deb.debian.org/debian stretch-updates InRelease
Ign:5 http://deb.debian.org/debian stretch Release
Ign:6 http://deb.debian.org/debian stretch-updates Release
Ign:7 http://deb.debian.org/debian stretch/main arm64 Packages
Ign:8 http://deb.debian.org/debian stretch/main all Packages
Ign:9 http://deb.debian.org/debian stretch-updates/main arm64 Packages
Ign:10 http://deb.debian.org/debian stretch-updates/main all Packages
Ign:7 http://deb.debian.org/debian stretch/main arm64 Packages
Ign:8 http://deb.debian.org/debian stretch/main all Packages
Ign:11 http://security.debian.org stretch/updates/main arm64 Packages
Ign:12 http://security.debian.org stretch/updates/main all Packages
Ign:11 http://security.debian.org stretch/updates/main arm64 Packages
Ign:9 http://deb.debian.org/debian stretch-updates/main arm64 Packages
Ign:12 http://security.debian.org stretch/updates/main all Packages
Ign:11 http://security.debian.org stretch/updates/main arm64 Packages
Ign:12 http://security.debian.org stretch/updates/main all Packages
Ign:11 http://security.debian.org stretch/updates/main arm64 Packages
Ign:10 http://deb.debian.org/debian stretch-updates/main all Packages
Ign:7 http://deb.debian.org/debian stretch/main arm64 Packages
Ign:12 http://security.debian.org stretch/updates/main all Packages
Ign:8 http://deb.debian.org/debian stretch/main all Packages
Ign:9 http://deb.debian.org/debian stretch-updates/main arm64 Packages
Ign:10 http://deb.debian.org/debian stretch-updates/main all Packages
Ign:7 http://deb.debian.org/debian stretch/main arm64 Packages
Ign:8 http://deb.debian.org/debian stretch/main all Packages
Ign:9 http://deb.debian.org/debian stretch-updates/main arm64 Packages
Ign:10 http://deb.debian.org/debian stretch-updates/main all Packages
Ign:7 http://deb.debian.org/debian stretch/main arm64 Packages
Ign:8 http://deb.debian.org/debian stretch/main all Packages
Ign:11 http://security.debian.org stretch/updates/main arm64 Packages
Ign:9 http://deb.debian.org/debian stretch-updates/main arm64 Packages
Ign:12 http://security.debian.org stretch/updates/main all Packages
Ign:10 http://deb.debian.org/debian stretch-updates/main all Packages
Err:7 http://deb.debian.org/debian stretch/main arm64 Packages
  404  Not Found
Ign:8 http://deb.debian.org/debian stretch/main all Packages
Err:9 http://deb.debian.org/debian stretch-updates/main arm64 Packages
  404  Not Found
Ign:10 http://deb.debian.org/debian stretch-updates/main all Packages
Err:11 http://security.debian.org stretch/updates/main arm64 Packages
  404  Not Found
Ign:12 http://security.debian.org stretch/updates/main all Packages
Reading package lists...
W: The repository 'http://security.debian.org stretch/updates Release' does not have a Release file.
W: The repository 'http://deb.debian.org/debian stretch Release' does not have a Release file.
W: The repository 'http://deb.debian.org/debian stretch-updates Release' does not have a Release file.
E: Failed to fetch http://security.debian.org/dists/stretch/updates/main/binary-arm64/Packages  404  Not Found
E: Failed to fetch http://deb.debian.org/debian/dists/stretch/main/binary-arm64/Packages  404  Not Found
E: Failed to fetch http://deb.debian.org/debian/dists/stretch-updates/main/binary-arm64/Packages  404  Not Found
E: Some index files failed to download. They have been ignored, or old ones used instead.
Error response from daemon: The command '/bin/sh -c apt-get update &&     apt-get install -y python-dev python-pip' returned a non-zero code: 100
Failed to deploy '<unknown> Dockerfile: Dockerfile': Can't retrieve image ID from build stream

此Dockerfile用于构建精细,直到最近才开始抛出此错误

EN

回答 3

Unix & Linux用户

回答已采纳

发布于 2023-04-24 07:30:46

拉伸已被移动到archive.debian.org,您需要更新存储库配置,或者更好地使用更新的基本映像。

要更新您的存储库配置,请将deb.debian.org更改为archive.debian.org,行中引用/etc/apt/sources.list中的拉伸,在/etc/apt/sources.list.d中引用文件。

票数 47
EN

Unix & Linux用户

发布于 2023-04-24 10:07:56

谢谢@斯蒂芬-凯特!我希望他们用这样的更改来更新码头映像:

如果它有助于我们需要通过以下更改更新停靠映像(python:3.7.3-slim)以绕过错误(同时仍然能够安装基本软件包):

RUN echo "deb http://archive.debian.org/debian stretch main" > /etc/apt/sources.list

至少PGP的钥匙没动过..。

票数 34
EN

Unix & Linux用户

发布于 2023-04-24 11:50:38

谢谢@Stephen_Kitt和@Ben_Kaplan给出的有用的答案!

在它们的启发下,我将以下内容添加到我的Dockerfile中,以切换到archive.debian.org:

代码语言:javascript
复制
RUN sed -i s/deb.debian.org/archive.debian.org/g /etc/apt/sources.list

这样,所有的操作都很好,不会出现误导性错误消息。

编辑:下面是Scott的评论,只有当没有其他资源时,listet deb.debian.org才能工作。

票数 4
EN
页面原文内容由Unix & Linux提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://unix.stackexchange.com/questions/743839

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档