maven:3.5.2-jdk-8에서 dockerfile을 빌드할 때 apt-get 업데이트가 debian amd64 패키지를 얻을 수 없습니다.

maven:3.5.2-jdk-8에서 dockerfile을 빌드할 때 apt-get 업데이트가 debian amd64 패키지를 얻을 수 없습니다.

도커파일:

FROM maven:3.5.2-jdk-8

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

빌드 로그:

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은 잘 빌드되는 데 사용되었으며 최근에 이 오류가 발생하기 시작했습니다.

답변1

Stretch가 archive.debian.org로 옮겨졌습니다., 저장소 구성을 업데이트해야 하거나 더 나은 방법이 필요합니다.최신 기본 이미지 사용.

저장소 구성을 업데이트하려면 확장 및 파일을 참조 deb.debian.org하는 줄을 변경하세요 .archive.debian.org/etc/apt/sources.list/etc/apt/sources.list.d

답변2

@Stephen-kitt에게 감사드립니다! 이 변경 사항으로 도커 이미지를 업데이트하길 바랍니다 :(

python:3.7.3-slim누군가에게 도움이 된다면, 오류를 우회하기 위해(아직 기본 패키지를 설치할 수 있는 동안) Docker 이미지를 다음 변경 사항으로 업데이트 해야 합니다 .

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

최소한 PGP 키는 건드리지 않았네요...

답변3

유용한 답변을 주신 @Stephen_Kitt 및 @Ben_Kaplan에게 감사드립니다!

이에 영감을 받아 Dockerfile에 다음을 추가하여 archive.debian.org로 전환했습니다.

RUN sed -i s/deb.debian.org/archive.debian.org/g /etc/apt/sources.list
RUN sed -i s/security.debian.org/archive.debian.org/g /etc/apt/sources.list
RUN sed -i s/stretch-updates/stretch/g /etc/apt/sources.list

이렇게 하면 모든 것이 잘 작동하고 오해의 소지가 있는 오류 메시지가 팝업되지 않습니다.

편집: 아래 댓글을 통해스캇 G, 이 방법은 나열된 다른 소스가 없는 경우에만 작동합니다 deb.debian.org.

답변4

비슷한 문제가 있는 노드 12 이미지의 경우 libnotify를 설치하기 위해 debian 보안도 추가해야 했습니다.

다음 줄을 추가하여 도커 이미지가 다시 작동하도록 했습니다.

첫 번째 줄은 source.list의 기존 콘텐츠를 덮어쓰고 나머지 콘텐츠는 "새" 소스 파일에 추가됩니다.

RUN MAJOR_VERSION=$(echo $NODE_VERSION | cut -d '.' -f 1) && \
    if [ "$MAJOR_VERSION" = "12" ] ; then \
    echo "deb [trusted=yes] http://archive.debian.org/debian stretch main non-free contrib" > /etc/apt/sources.list && \
    echo 'deb-src [trusted=yes] http://archive.debian.org/debian/ stretch main non-free contrib'  >> /etc/apt/sources.list && \
    echo 'deb [trusted=yes] http://archive.debian.org/debian-security/ stretch/updates main non-free contrib'  >> /etc/apt/sources.list; \
    fi

관련 정보