기본 패키지에서 충족되지 않은 종속성 - jenkins dockerfile

기본 패키지에서 충족되지 않은 종속성 - jenkins dockerfile

도커 파일은 다음과 같습니다.

FROM jenkins:2.60.3

ENV DEBIAN_FRONTEND=noninteractive

USER root
ARG DOCKER_GID=497

RUN groupadd -g ${DOCKER_GID:-497} docker

ARG DOCKER_ENGINE=1.10.2
ARG DOCKER_COMPOSE=1.6.2

# Install base packages for docker, docker-compose & ansible
RUN apt-get update -y && \
    apt-get install apt-transport-https curl python-dev python-setuptools gcc make libssl-dev -y && \
    easy_install pip

# Install docker engine
RUN apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D && \
    echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" | tee /etc/apt/sources.list.d/docker.list && \
    apt-get update -y && \
    apt-get purge lxc-docker* -y && \
    apt-get install docker-engine=${DOCKER_ENGINE:-1.10.2}-0~trusty -y && \
    usermod -aG docker jenkins && \
    usermod -aG users jenkins

# Install docker compose
RUN pip install docker-compose==${DOCKER_COMPOSE:-1.6.2} && \
    pip install ansible boto boto3

# Change to jenkins user
USER jenkins

# Add jenkins plugin
COPY plugins.txt /usr/share/jenkins/plugins.txt
RUN /usr/local/bin/plugins.sh /usr/share/jenkins/plugins.txt

다음과 같은 오류가 발생합니다.

Step 9/14 : RUN apt-get update -y &&     apt-get install apt-transport-https curl python-dev python-setuptools gcc make libssl-dev -y &&     easy_install pip
 ---> Using cache
 ---> 297087071292
Step 10/14 : RUN apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D &&     echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" | tee /etc/apt/sources.list.d/docker.list &&     apt-get update -y &&     apt-get purge lxc-docker* -y &&     apt-get install docker-engine=${DOCKER_ENGINE:-1.10.2}-0~trusty -y &&     usermod -aG docker jenkins &&     usermod -aG users jenkins
 ---> Running in 10daeb70c472
Warning: apt-key output should not be parsed (stdout is not a terminal)
Executing: /tmp/apt-key-gpghome.ls7Ck5WuuS/gpg.1.sh --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
gpg: key F76221572C52609D: public key "Docker Release Tool (releasedocker) <[email protected]>" imported
gpg: Total number processed: 1
gpg:               imported: 1
deb https://apt.dockerproject.org/repo ubuntu-trusty main
Get:1 http://security.debian.org/debian-security stretch/updates InRelease [94.3 kB]
Ign:2 http://deb.debian.org/debian stretch InRelease
Get:3 http://deb.debian.org/debian stretch-updates InRelease [91.0 kB]
Hit:4 http://deb.debian.org/debian stretch Release
Get:5 http://security.debian.org/debian-security stretch/updates/main amd64 Packages [500 kB]
Get:6 https://apt.dockerproject.org/repo ubuntu-trusty InRelease [48.7 kB]
Get:8 https://apt.dockerproject.org/repo ubuntu-trusty/main amd64 Packages [7033 B]
Fetched 741 kB in 1s (606 kB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
Package 'lxc-docker' is not installed, so not removed
Package 'lxc-docker-virtual-package' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 57 not upgraded.
Reading package lists...
Building dependency tree...
Reading state information...
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:
 docker-engine : Depends: libsystemd-journal0 (>= 201) but it is not installable
                 Recommends: aufs-tools but it is not going to be installed
                 Recommends: cgroupfs-mount but it is not going to be installed or
                             cgroup-lite but it is not installable
                 Recommends: apparmor but it is not going to be installed
                 Recommends: yubico-piv-tool (>= 1.1.0~) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
ERROR: Service 'jenkins' failed to build: The command '/bin/sh -c apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D &&     echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" | tee /etc/apt/sources.list.d/docker.list &&     apt-get update -y &&     apt-get purge lxc-docker* -y &&     apt-get install docker-engine=${DOCKER_ENGINE:-1.10.2}-0~trusty -y &&     usermod -aG docker jenkins &&     usermod -aG users jenkins' returned a non-zero code: 100

다음 지침으로 인해 이 오류가 발생합니다.

  apt-get install docker-engine=${DOCKER_ENGINE:-1.10.2}-0~trusty -y
  deb https://apt.dockerproject.org/repo ubuntu-trusty main

1) 충족되지 않은 종속성을 해결하는 방법은 무엇입니까?

2) 어떤 버전의 Jenkins를 권장합니까? 현재 기본 이미지를 사용 중입니다.2.60.3

답변1

제공된 출력에서 ​​특정 문제는 설치하려는 패키지가 에 종속되어 있고 libsystemd-journal0해당 패키지를 제공하는 저장소를 구성하지 않았다는 것입니다. 컨테이너 내에 Debian과 Ubuntu 리포지토리를 혼합하고 있는 것으로 보이며, 이것이 문제의 원인일 수 있습니다.

내가 아는 한, 사용 중인 Docker 이미지는 Ubuntu도 아니고 Debian Stretch에서 실행 중이므로 해당 컨테이너 내에 Ubuntu Docker 저장소를 설치하면 안 됩니다.

Debian Stretch의 Docker 저장소를 사용하여 컨테이너를 생성하면 빌드되어야 합니다.

다른 질문은 Docker가 Docker 내부에서 실행되도록 하려고 한다는 것입니다. Docker에는 자체적으로 몇 가지 문제/제한 사항이 있지만 컨테이너가 빌드되면 이 문제가 발생할 수 있으므로 제출해야 할 것입니다. 추가 문제로.

권장되는 Jenkins Docker 이미지는 링크현재 사용하고 있는 이미지에서나를 데려다 줘이 사진openjdk-8또한 Debian Stretch에서 실행되는 것처럼 보입니다.

관련 정보