无法在 ubuntu 映像中安装 docker 引擎,因为 libsystemd0 无法安装

无法在 ubuntu 映像中安装 docker 引擎,因为 libsystemd0 无法安装

我正在尝试构建一个基于 ubuntu 的容器映像,该映像上安装了 docker 引擎。这是我的 dockerfile 中的内容:

FROM ubuntu:trusty

MAINTAINER Ervin Varga 

RUN apt-get update

RUN apt-get -y upgrade

RUN apt-get install -y openssh-server

RUN sed -i 's|session required pam_loginuid.so|session optional pam_loginuid.so|g' /etc/pam.d/sshd

RUN mkdir -p /var/run/sshd

RUN apt-get -y install openjdk-7-jre 

RUN apt-get -y install openjdk-7-jdk 

RUN adduser --quiet jenkins

RUN echo "jenkins:jenkins" | chpasswd

RUN apt-get -y install apt-transport-https ca-certificates curl software-properties-common aufs-tools cgroup-lite git apparmor

RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

RUN add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable"

RUN apt-add-repository 'deb https://apt.dockerproject.org/repo ubuntu-xenial main'

RUN apt-get update

RUN apt-get -y install docker-engine

RUN sudo usermod -aG docker ${USER}

RUN su - ${USER}

EXPOSE 22

CMD ["/usr/sbin/sshd", "-D"]`enter code here`

当我构建图像时,我得到了:

The following packages have unmet dependencies:
 docker-engine : Depends: init-system-helpers (>= 1.18~) but 1.14ubuntu1 is to be installed
                 Depends: lsb-base (>= 4.1+Debian11ubuntu7) but 4.1+Debian11ubuntu6.2 is to be installed
                 Depends: libdevmapper1.02.1 (>= 2:1.02.97) but 2:1.02.77-6ubuntu2 is to be installed
                 Depends: libltdl7 (>= 2.4.6) but it is not going to be installed
                 Depends: libsystemd0 but it is not installable
E: Unable to correct problems, you have held broken packages.
The command '/bin/sh -c apt-get -y install docker-engine' returned a non-zero code: 100

有人可以告诉我如何解决这个问题吗?

相关内容