0

I am building a debian package atlantis-builder.deb with folder structure as:

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

The control file has content as:

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.

The postinst and postrm contains steps to download sbt and its jar removing steps respectively.

The Makefile content is :

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) .

I am building a docker image with Dockerfile content as:

# 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

I am getting following error in step 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

Could anyone help me why I am getting error as lxc-docker is not installed? However, I am installing lxc-docker in Dockerfile step RUN apt-get install -qqy --force-yes lxc-docker-1.1.2.

Also, when I don't specify version of docker i.e lxc-docker only instead of lxc-docker-1.1.2, it doesn't give any error but installs latest version of Docker which I don't want.

brg
  • 101
  • 4
  • Do you have lxc-docker installed on the host? – Richard Salts Jan 09 '15 at 07:11
  • Yes it is installed with version 1.1.2. Just wondering how it relates to lxc-docker installation step inside Dockerfile. – brg Jan 09 '15 at 07:15
  • I think "RUN apt-get install -qqy --force-yes lxc-docker-1.1.2" is the problem. If you want a specific version the syntax is apt-get install package=version. Does that help? – Richard Salts Jan 09 '15 at 07:19
  • For docker, to install specific version, we need to write as apt-get install lxc-docker-. – brg Jan 09 '15 at 07:21

0 Answers0