基本パッケージで満たされていない依存関係 - 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リポジトリを使用してコンテナを作成したら、ビルドする必要があります。

もう1つの質問は、DockerがDockerの内部で実行されるようにすることです。 Dockerには独自のいくつかの問題/制限がありますが、コンテナがビルドされるとこの問題が発生する可能性があるため、送信する必要があります。さらなる問題として。

推奨されるJenkins Dockerイメージはリンクです現在使用している画像から私を連れて行ってこの写真openjdk-8また、Debian Stretchで実行されているようです。

おすすめ記事