[server] api-get Docker에서 “서버에서 읽는 동안 오류가 발생했습니다”

Bash에서 다음 명령을 실행 중입니다.

DEBIAN_FRONTEND=noninteractive apt-get update -qq \
  && apt-get install -y build-essential git libncurses5-dev openssl \
     libssl-dev  fop xsltproc unixodbc-dev curl

실행되지만 중간에 실패합니다.

Get:96 http://security.debian.org/ jessie/updates/main linux-libc-dev amd64 3.16.7-ckt9-3~deb8u1 [991 kB]
Get:97 http://security.debian.org/ jessie/updates/main curl amd64 7.38.0-4+deb8u2 [200 kB]
Get:98 http://security.debian.org/ jessie/updates/main openjdk-7-jre amd64 7u79-2.5.5-1~deb8u1 [176 kB]
Get:99 http://http.debian.net/debian/ jessie/main libgtk2.0-0 amd64 2.24.25-3 [2301 kB]
Err http://http.debian.net/debian/ jessie/main dpkg-dev all 1.17.25
  Error reading from server. Remote end closed connection [IP: 176.9.184.93 80]
Get:100 http://http.debian.net/debian/ jessie/main libatk-wrapper-java all 0.30.5-1 [30.3 kB]
Get:101 http://http.debian.net/debian/ jessie/main libatk-wrapper-java-jni amd64 0.30.5-1 [24.8 kB]
Get:102 http://http.debian.net/debian/ jessie/main libatomic1 amd64 4.9.2-10 [8992 B]
Get:103 http://http.debian.net/debian/ jessie/main libavahi-glib1 amd64 0.6.31-5 [36.4 kB]

따라서 전체 작업이 오류와 함께 실패

E: Failed to fetch http://http.debian.net/debian/pool/main/d/dpkg/dpkg-dev_1.17.25_all.deb  Error reading from server. Remote end closed connection [IP: 176.9.184.93 80]

E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

Docker 빌드의 일부로 이것을 실행하고 있습니다. 내 Dockerfile이 읽습니다.

FROM debian:jessie
RUN DEBIAN_FRONTEND=noninteractive  \
    apt-get update -qq \
    && apt-get install -y \
       build-essential \
       git \
       libncurses5-dev \
       openssl \
       libssl-dev \
       fop \
       xsltproc \
       unixodbc-dev \
       curl

그리고 나는 달리고있다 docker build -t my-base:latest .

apt-get명령은 어느 정도 시간이 걸리고 아무 것도 변경하지 않고 얼마 동안 실패합니다. 보인다 나는 종종 내 로컬 개발 컴퓨터에서 실행하지만, 실패 할 때 항상 성공 (항상하지만!) 내가 EC2 시스템에서 실행 때. 또한 도움을 apt-get update받기 전에 두 번 연속 실행하는 것처럼 보입니다 apt-get install. 그래도 마지막 두 문장에 대해서는 전혀 긍정적이지 않습니다.

어떤 아이디어가 일어날 수 있습니까? apt-get에 타임 스탬프를 캐싱 한 다음 현재 상태가 될 것으로 예상되는 것이 있습니까?



답변

액세스하는 리포지토리는 자주 변경되지만 기본 이미지 (및 캐시 된 메타 데이터)는 변경되지 않기 때문에 Docker 이미지에서 더 자주 볼 수있는 문제입니다.

apt-get clean && apt-get update패키지를 설치하기 전에 실행 해보십시오 .


답변