关于docker:解压软件包时出现Dpkg依赖问题

关于docker:解压软件包时出现Dpkg依赖问题

我正在构建一个 debian 包,atlantis-builder.deb其文件夹结构如下:

- deb
     - DEBIAN
            - control
            - postinst
            - postrm
     - usr 
         - bin
             - sbt

控制文件内容如下:

Package: __PACKAGE__
Version: __VERSION__
Section: base
Priority: Optional
Architecture: amd64
Depends: lxc-docker (>= 0.9.0), git, openjdk-7-jdk
Maintainer: abc
Description: Best. Builder. Ever.

postinstpostrm分别包含下载sbt的步骤和其jar的删除步骤。

内容Makefile如下:

DEB_STAGING := $(PROJECT_ROOT)/staging
PKG_INSTALL_DIR := $(DEB_STAGING)/opt/atlantis
PKG_BIN_DIR := $(PKG_INSTALL_DIR)/builder/bin
....
....
deb-builder: clean-builder build-builder
    @mkdir -p $(DEB_STAGING)/DEBIAN
    @mkdir -p $(PKG_BIN_DIR)

    @cp -a $(PROJECT_ROOT)/deb/DEBIAN/control $(DEB_STAGING)/DEBIAN/control
    @cp atlantis-builder $(PKG_BIN_DIR)

    @sed -ri "s/__VERSION__/$(VERSION)/" $(DEB_STAGING)/DEBIAN/control
    @sed -ri "s/__PACKAGE__/atlantis-builder/" $(DEB_STAGING)/DEBIAN/control
    @dpkg -b $(DEB_STAGING) .

我正在构建一个docker镜像,其Dockerfile内容如下:

# Set up docker-in-docker
RUN apt-get update -qq
RUN apt-get install -qqy --force-yes lxc-docker-1.1.2

# Install java before addiing files for better caching
RUN echo oracle-java7-installer shared/accepted-oracle-license-v1-1 select true | sudo /usr/bin/debconf-set-selections
RUN apt-get install oracle-java7-installer -y

ADD atlantis-builder.deb /tmp/atlantis-builder.deb     
RUN dpkg -i /tmp/atlantis-builder.deb || true          # error here

我在步骤中收到以下错误RUN dpkg -i /tmp/atlantis-builder.deb

Selecting previously unselected package atlantis-builder.
(Reading database ... 17906 files and directories currently installed.)
Preparing to unpack /tmp/atlantis-builder.deb ...
Unpacking atlantis-builder (0.1.0) ...
dpkg: dependency problems prevent configuration of atlantis-builder:
 atlantis-builder depends on lxc-docker (>= 0.9.0); however:
  Package lxc-docker is not installed.

dpkg: error processing package atlantis-builder (--install):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 atlantis-builder

有人能帮我解决为什么出现未安装的错误吗?但是,我正在步骤lxc-docker中安装 lxc-docker 。DockerfileRUN apt-get install -qqy --force-yes lxc-docker-1.1.2

此外,当我没有指定 docker 的版本而lxc-docker只指定 时lxc-docker-1.1.2,它不会出现任何错误,但会安装Docker我不想要的最新版本。

相关内容