2017-01-31 3 views
1

문제없이 여러 번 사용했던 Dockerfile이 있습니다. 나는 그때 다른 사람에 대해 불평 목록에 패키지를 추가하는 경우Docker : 문제를 해결할 수 없습니다. 손상된 패키지를 가지고 있습니다.

Sending build context to Docker daemon 645.3 MB 
Sending build context to Docker daemon 
Step 0 : FROM debian:jessie 
---> 736e5442e772 
Step 1 : MAINTAINER Larry Martell <[email protected]> 
---> Using cache 
---> bd272aa26940 
Step 2 : ENV HOME /opt/django/CAPgraph/ 
---> Using cache 
---> 1c540ed91808 
Step 3 : RUN echo "deb http://http.debian.net/debian jessie-backports main" >> /etc/apt/sources.list 
---> Using cache 
---> 8788d48e625d 
Step 4 : RUN (apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential git python python-dev python-setuptools nginx sqlite3 supervisor mysql-server libmysqlclient-dev vim cron unzip software-properties-common python-software-properties openjdk-8-jre xvfb wkhtmltopdf ssmtp sendmail) 
---> Running in 8986bca93fdb 
Get:1 http://security.debian.org jessie/updates InRelease [63.1 kB] 
Get:2 http://security.debian.org jessie/updates/main amd64 Packages [436 kB] 
Get:3 http://http.debian.net jessie-backports InRelease [166 kB] 
Get:4 http://httpredir.debian.org jessie-updates InRelease [145 kB] 
Get:5 http://http.debian.net jessie-backports/main amd64 Packages [1031 kB] 
Get:6 http://httpredir.debian.org jessie-updates/main amd64 Packages [17.6 kB] 
Ign http://httpredir.debian.org jessie InRelease 
Get:7 http://httpredir.debian.org jessie Release.gpg [2373 B] 
Get:8 http://httpredir.debian.org jessie Release [148 kB] 
Get:9 http://httpredir.debian.org jessie/main amd64 Packages [9049 kB] 
Fetched 11.1 MB in 9s (1211 kB/s) 
Reading package lists... 
Reading package lists... 
Building dependency tree... 
Some packages could not be installed. This may mean that you have 
requested an impossible situation or if you are using the unstable 
distribution that some required packages have not yet been created 
or been moved out of Incoming. 
The following information may help to resolve the situation: 

The following packages have unmet dependencies: 
sendmail : Depends: sendmail-bin but it is not going to be installed 
E: Unable to correct problems, you have held broken packages. 
The command '/bin/sh -c (apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential git python python-dev python-setuptools nginx sqlite3 supervisor mysql-server libmysqlclient-dev vim cron unzip software-properties-common python-software-properties openjdk-8-jre xvfb wkhtmltopdf ssmtp sendmail)' returned a non-zero code: 100 

: 나는 빌드가 실패를 추가 할 때 지금은 그것 (ssmtp 및 센드 메일) 및 일부 패키지를 추가해야합니다. 이 '깨진 꾸러미'메시지의 의미는 무엇이며 어떻게 수정합니까?

FROM debian:jessie ENV HOME /opt/django/CAPgraph/ 
RUN echo "deb http://http.debian.net/debian jessie-backports main" >> /etc/apt/sources.list 
RUN (apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential git python python-dev python-setuptools nginx sqlite3 supervisor mysql-server libmysqlclient-dev vim cron unzip software-properties-common python-software-properties openjdk-8-jre xvfb wkhtmltopdf sendmail ssmtp) 

내가 센드 메일 - 빈을 추가하는 시도하고 그것이 실패했습니다 : 다음 메일 전송 에이전트를 추가

The following packages have unmet dependencies: 
sendmail-bin : Conflicts: mail-transport-agent 
ssmtp : Conflicts: mail-transport-agent 
E: Unable to correct problems, you have held broken packages. 

과 실패 여기

내 Dockerfile의 첫 번째 부분입니다 with :

Package mail-transport-agent is a virtual package provided by: 
    opensmtpd 5.7.3p2-1~bpo8+1 
    ssmtp 2.64-8 
    sendmail-bin 8.14.4-8+deb8u1 
    qmail-run 2.0.2+nmu1 
    postfix 2.11.3-1 
    nullmailer 1:1.13-1+deb8u1 
    msmtp-mta 1.4.32-2 
    masqmail 0.2.30-1 
    lsb-invalid-mta 4.1+Debian13+nmu1 
    exim4-daemon-light 4.84.2-2+deb8u3 
    exim4-daemon-heavy 4.84.2-2+deb8u3 
    esmtp-run 1.2-12 
    dma 0.9-1 
    courier-mta 0.73.1-1.6 
    citadel-mta 8.24-1+b3 

E: Package 'mail-transport-agent' has no installation candidate 
+0

실패한 apt-get 설치의 마지막 줄은 거의 유용하지 않습니다. 첫 번째 오류로 돌아가서 질문에 포함 시키시겠습니까? – BMitch

+0

도커 빌드에서 전체 출력을 추가했습니다. –

+0

허, 당신은 마지막 줄이 정말로 유용한 그 드문 경우 중 하나가 될 수 있습니다. – BMitch

답변

2

데비안은 하나의 메일 전송 에이전트 만 허용하도록 설정되어 있으며 설치 명령 ssmtp와 sendmail/sendmail-bin 두 가지를 포함하려고합니다. 서로 충돌하기 때문에 설치 명령에서이 중 하나를 제거해야합니다.

1

sendmail 의존성이 있다면 파이썬 응용 프로그램이 sendmail 바이너리를 통해 전자 메일을 보낼 수 있으므로 ssmtp을 설치하고 외부 MTA를 사용하도록 구성하십시오.

Docker 컨테이너에서 sendmail을 실행하지 않는 것이 좋습니다.

+0

예, 파이썬 스크립트에서 전자 메일을 보내야합니다. 먼저 컨테이너에서 ssmtp를 설치했지만 메일이 전송되지 않았습니다. 그런 다음 sendmail을 설치하면 제대로 작동합니다. 왜 내가 컨테이너 내부에서 그들을 둘 다 설치할 수 있는지 모르겠지만 Dockerfile에서 수 없습니다. 외부 MTA를 사용하도록 ssmtp를 구성하는 방법을 보여주는 사이트에서 나를 가리킬 수 있습니까? –

+0

sendmail이 아닌 python 스크립트에서 smtp 패키지를 사용하고 있습니다. –

+1

@LarryMartell 명령 줄에서 설치를 수행했을 때 동시에 설치 했습니까? ssmtp가 이미 설치된 후 sendmail을 설치 한 경우 충돌로 인해 ssmtp가 자동으로 제거됩니다. – BMitch