jdidion / atropos

An NGS read trimming tool that is specific, sensitive, and speedy. (production)
Other
119 stars 15 forks source link

Dockerfile for atropos-paper fails to build due to required apt-get upgrade interactivity #90

Closed nkrumm closed 4 years ago

nkrumm commented 4 years ago

The atropos-paper docker container also is currently failing to build for me.

The error occurs during the RUN apt-get ...

Unpacking util-linux (2.27.1-6ubuntu3.9) over (2.27.1-6ubuntu3.3) ...
Processing triggers for mime-support (3.59ubuntu1) ...   
Setting up util-linux (2.27.1-6ubuntu3.9) ...

Configuration file '/etc/cron.weekly/fstrim'
 ==> Deleted (by you or by a script) since installation. 
 ==> Package distributor has shipped an updated version. 
   What would you like to do about it ?  Your options are:
    Y or I  : install the package maintainer's version   
    N or O  : keep your currently-installed version
      D     : show the differences between the versions  
      Z     : start a shell to examine the situation
 The default action is to keep your current version.
*** fstrim (Y/I/N/O/D/Z) [default=N] ? dpkg: error processing package util-linux (--configure):
 end of file on stdin at conffile prompt
Errors were encountered while processing:
 util-linux
E: Sub-process /usr/bin/dpkg returned an error code (1)
The command '/bin/sh -c apt-get update     && DEBIAN_FRONTEND=noninteractive apt-get -y upgrade     && DEBIAN_FRONTEND=noninteractive apt-get install -y -qq         $BUILD_PACKAGES   
      $RUNTIME_PACKAGES         --option=Dpkg::Options::=--force-confdef     && ln -s /usr/bin/python3 /usr/bin/python     && ln -s /usr/bin/pip3 /usr/bin/pip     && pip install cython     && git clone --recursive --branch $VERSION https://github.com/jdidion/atropos     && cd atropos     && make install     && cd ..    && apt-get remove --purge -y $BUILD_PACKAGES     && apt-get autoremove -y     && rm -rf /var/lib/apt/lists/* /tmp/*     && locale-gen en_US.UTF-8     && update-locale LANG=en_US.UTF-8' returned a non-zero code: 100

The error apt-get upgrade is giving is due to not having -o Dpkg::Options::="--force-confold" to keep existing configurations. It is recommended by the Phusion docs to include this when doing an upgrade in a Dockerfile: https://github.com/phusion/passenger-docker#upgrading_os

Adding this allows the docker container to build:

ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
    && DEBIAN_FRONTEND=noninteractive apt-get -y upgrade \
        --option=Dpkg::Options::=--force-confdef \
    && DEBIAN_FRONTEND=noninteractive apt-get install -y -qq \
        $BUILD_PACKAGES \
        $RUNTIME_PACKAGES \
        --option=Dpkg::Options::=--force-confdef \
jdidion commented 4 years ago

Thanks! This change is now in develop branch.