首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >基包中未满足的依赖项- jenkins dockerfile

基包中未满足的依赖项- jenkins dockerfile
EN

Unix & Linux用户
提问于 2019-11-08 18:59:06
回答 1查看 557关注 0票数 0

下面是dockerfile:

代码语言:javascript
复制
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

给出以下错误:

代码语言:javascript
复制
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) " 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

下面的说明会导致此错误:

代码语言:javascript
复制
  apt-get install docker-engine=${DOCKER_ENGINE:-1.10.2}-0~trusty -y
  deb https://apt.dockerproject.org/repo ubuntu-trusty main

1)如何解决这些未满足的依赖关系?

2)詹金斯的推荐版本是哪一种?目前使用的是基本图像2.60.3

EN

回答 1

Unix & Linux用户

发布于 2019-11-08 21:47:56

从提供的输出中,您的具体问题是您想要安装的包依赖于libsystemd-journal0,并且您没有提供该包的配置存储库。似乎您的容器中混合了Debian和Ubuntu存储库,这可能是问题的根源。

据我所知,您使用的Docker映像甚至不是Ubuntu,它运行在Debian拉伸上,所以您不应该在容器中安装Ubuntu存储库。

使用用于Debian拉伸的Docker存储库生成容器后,应该构建容器。

您的另一个问题是,您正在试图让Docker在Docker内部运行,您会发现Docker有一些自己的问题/限制,但是一旦容器生成,您可能会达到这个目标,并且可能会作为附加问题提交。

至于推荐的Jenkins映像,链接从当前正在使用的图像中把我带到了这幅图像,它看起来也在Debian扩展上运行openjdk-8

票数 1
EN
页面原文内容由Unix & Linux提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://unix.stackexchange.com/questions/551183

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档