Skip to content

Commit

Permalink
Move dependencies out of Dockerfile
Browse files Browse the repository at this point in the history
- Add bin/install.sh to install BBS dependencies

- Add Ubuntu-files to track docker-specific dependencies

- Move install.R to bin
  • Loading branch information
jwokaty committed Jun 29, 2021
1 parent 867d099 commit 9f799a4
Show file tree
Hide file tree
Showing 6 changed files with 158 additions and 123 deletions.
128 changes: 5 additions & 123 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ARG BIOCONDUCTOR_VERSION=3.14
##### IMPORTANT ########
## The PATCH version number should be incremented each time
## there is a change in the Dockerfile.
ARG BIOCONDUCTOR_PATCH=2
ARG BIOCONDUCTOR_PATCH=5
ARG BIOCONDUCTOR_DOCKER_VERSION=${BIOCONDUCTOR_VERSION}.${BIOCONDUCTOR_PATCH}

LABEL name="bioconductor/bioconductor_docker" \
Expand All @@ -29,133 +29,15 @@ RUN dpkg --clear-avail
# 'debconf: unable to initialize frontend: Dialog'
ENV DEBIAN_FRONTEND noninteractive

# Update apt-get
RUN apt-get update \
&& apt-get install -y --no-install-recommends apt-utils \
&& apt-get install -y --no-install-recommends \
## Basic deps
gdb \
libxml2-dev \
python3-pip \
libz-dev \
liblzma-dev \
libbz2-dev \
libpng-dev \
libgit2-dev \
## sys deps from bioc_full
pkg-config \
fortran77-compiler \
byacc \
automake \
curl \
## This section installs libraries
libpcre2-dev \
libnetcdf-dev \
libhdf5-serial-dev \
libfftw3-dev \
libopenbabel-dev \
libopenmpi-dev \
libxt-dev \
libudunits2-dev \
libgeos-dev \
libproj-dev \
libcairo2-dev \
libtiff5-dev \
libreadline-dev \
libgsl0-dev \
libgslcblas0 \
libgtk2.0-dev \
libgl1-mesa-dev \
libglu1-mesa-dev \
libgmp3-dev \
libhdf5-dev \
libncurses-dev \
libbz2-dev \
libxpm-dev \
liblapack-dev \
libv8-dev \
libgtkmm-2.4-dev \
libmpfr-dev \
libmodule-build-perl \
libapparmor-dev \
libprotoc-dev \
librdf0-dev \
libmagick++-dev \
libsasl2-dev \
libpoppler-cpp-dev \
libprotobuf-dev \
libpq-dev \
libperl-dev \
## software - perl extentions and modules
libarchive-extract-perl \
libfile-copy-recursive-perl \
libcgi-pm-perl \
libdbi-perl \
libdbd-mysql-perl \
libxml-simple-perl \
libmysqlclient-dev \
default-libmysqlclient-dev \
libgdal-dev \
## new libs
libglpk-dev \
## Databases and other software
sqlite \
openmpi-bin \
mpi-default-bin \
openmpi-common \
openmpi-doc \
tcl8.6-dev \
tk-dev \
default-jdk \
imagemagick \
tabix \
ggobi \
graphviz \
protobuf-compiler \
jags \
## Additional resources
xfonts-100dpi \
xfonts-75dpi \
biber \
libsbml5-dev \
libzmq3-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
COPY bin /tmp
COPY Ubuntu-files /tmp

## Python installations
RUN apt-get update \
&& apt-get install -y software-properties-common \
&& add-apt-repository universe \
&& apt-get update \
&& apt-get -y --no-install-recommends install python2 python-dev \
&& curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output get-pip.py \
&& python2 get-pip.py \
&& pip2 install wheel \
## Install sklearn and pandas on python
&& pip2 install sklearn \
pandas \
pyyaml \
cwltool \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf get-pip.py

## FIXME
## These two libraries don't install in the above section--WHY?
RUN apt-get update \
&& apt-get -y --no-install-recommends install \
libmariadb-dev-compat \
libjpeg-dev \
libjpeg-turbo8-dev \
libjpeg8-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Install dependencies
RUN /bin/bash -C /tmp/install.sh

## Add host-site-library
RUN echo "R_LIBS=/usr/local/lib/R/host-site-library:\${R_LIBS}" > /usr/local/lib/R/etc/Renviron.site

ADD install.R /tmp/

RUN R -f /tmp/install.R

# DEVEL: Add sys env variables to DEVEL image
Expand Down
44 changes: 44 additions & 0 deletions Ubuntu-files/20.04/apt_required.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# APT required
byacc
curl
default-libmysqlclient-dev
fortran77-compiler
ggobi
imagemagick
libapparmor-dev
libarchive-extract-perl
libbz2-dev
libcgi-pm-perl
libdbd-mysql-perl
libdbi-perl
libfile-copy-recursive-perl
libgl1-mesa-dev
libgmp3-dev
libgsl0-dev
libgslcblas0
libhdf5-dev
libhdf5-serial-dev
libjpeg8-dev
libjpeg-turbo8-dev
liblapack-dev
#libmariadb-dev-compat # Depends on libmariadb-dev, conflicts with libmysqlclient-dev
libmodule-build-perl
libncurses-dev
libopenmpi-dev
libperl-dev
libprotoc-dev
librdf0-dev
libtiff5-dev
libxml-simple-perl
libxpm-dev
libz-dev
libzmq3-dev
mpi-default-bin
openmpi-bin
openmpi-common
openmpi-doc
pkg-config
software-properties-common
sqlite
tabix
tcl8.6-dev
48 changes: 48 additions & 0 deletions Ubuntu-files/20.04/apt_skip.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# APT skip
build-essential
clustalo
fuse
gfortran
git
gobjc
gsfonts-x11
infernal
kallisto
libavfilter-dev
libcurl4-openssl-dev
libeigen3-dev
libfribidi-dev
libfuse-dev
libgmp-dev # BD uses libgmp3-dev
libgraphviz-dev
libgsl-dev # BD uses libgsl0-dev
libicu-dev
librsvg2-dev
libssl-dev
libtiff-dev # BD uses libtiff5-dev
libx11-dev
manpages-dev
mlocate
mpi-default-dev # BD uses mpi-default-bin
ocl-icd-opencl-dev
pandoc
pandoc-citeproc
t1-xfree86-nonfree
tcl-dev # BD uses tcl8.6-dev
texi2html
texinfo
texlive
texlive-bibtex-extra
texlive-fonts-extra
texlive-font-utils
texlive-lang-european
texlive-latex-extra
texlive-luatex
texlive-pstricks
texlive-science
tree
ttf-xfree86-nonfree
ttf-xfree86-nonfree-syriac
xfonts-base # BD uses xfonts-100dpi and xfonts-75dpi
xfonts-scalable
zlib1g-dev
6 changes: 6 additions & 0 deletions Ubuntu-files/20.04/pip_skip.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
cwltool
pandas
pyyaml
sklearn
tensorflow
wheel
File renamed without changes.
55 changes: 55 additions & 0 deletions bin/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#!/bin/bash

set -e

# Set variables
version="20.04"
repo="https://github.com/Bioconductor/bbs"
branch="master"
bbs_files="/tmp/BBS/Ubuntu-files/$version"
bd_files="/tmp/$version"

# Get repository with Ubuntu-files
if [ ! -d "/tmp/BBS" ]; then
git clone $repo /tmp/BBS
cd /tmp/BBS
if [ $branch != "master" ]; then
git fetch origin $branch
git switch $branch
fi
cd ~
fi

# Constructing array of apt packages, removing unnecessary packages.
cat $bbs_files/apt_*.txt | awk '/^[^#]/ {print $1}' | sort >> /tmp/bbs_apt_pkgs
cat $bd_files/apt_*.txt | awk '/^[^#]/ {print $1}' | sort >> /tmp/skip_apt_pkgs
apt_pkgs=$(comm -23 /tmp/bbs_apt_pkgs /tmp/skip_apt_pkgs)

# Constructing array of pip packages, removing unnecessary packages.
cat $bbs_files/pip_*.txt | awk '/^[^#]/ {print $1}' | sort >> /tmp/bbs_pip_pkgs
cat $bd_files/pip_*.txt | awk '/^[^#]/ {print $1}' | sort >> /tmp/skip_pip_pkgs
pip_pkgs=$(comm -23 /tmp/bbs_pip_pkgs /tmp/skip_pip_pkgs)

# Packages always required by Bioconductor Docker
apt_required_pkgs=$(cat $bd_files/apt_required.txt | awk '/^[^#]/ {print $1}')

# Install dependencies

# Install apt packages
apt-get update \
&& apt-get install -y --no-install-recommends apt-utils

apt-get update \
&& apt-get install -y --no-install-recommends $apt_pkgs

apt-get update \
&& apt-get install -y --no-install-recommends $apt_required_pkgs \
&& apt-get clean && rm -rf /var/lib/apt/lists/*

# Install pip packages
pip3 install $pip_pkgs

# Remove files
if test -n "$(find /tmp -maxdepth 1 -name '*_pkgs' -print -quit)"; then
rm /tmp/*_pkgs
fi

0 comments on commit 9f799a4

Please sign in to comment.