Skip to content

Commit

Permalink
Move dependences out of Dockerfile
Browse files Browse the repository at this point in the history
- Add packages already installed via Rocker to skip file

- Move scripts to src

- Add comments to src/install.sh
  • Loading branch information
jwokaty committed Sep 7, 2021
1 parent dafcfd4 commit b82f00e
Show file tree
Hide file tree
Showing 6 changed files with 110 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=17
ARG BIOCONDUCTOR_PATCH=18
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 \
libeigen3-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 src /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 \
&& 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 bash /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
4 changes: 4 additions & 0 deletions Ubuntu-files/20.04/apt_required.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# APT required
curl
libzmq3-dev
python3-pip
34 changes: 34 additions & 0 deletions Ubuntu-files/20.04/apt_skip.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# APT skip
build-essential
clustalo # for LowMACA
default-jdk # Rocker
firefox # for packages using utils::browseURL()
#fuse # for Travel
gfortran # Rocker
git
gobjc
infernal # for inferrnal
kallisto # for rkal
#libavfilter-dev # for av/spacialHeatmap
libbz2-dev # Rocker
libcairo2-dev # Rocker
libcurl4-openssl-dev # Rocker
libfribidi-dev # for EnhancedVolcano--is this still needed?
#libfuse-dev # for Travel
libgraphviz-dev # for Rgraphviz
libicu-dev # Rocker
libjpeg-dev # Rocker
liblzma-dev # Rocker
#libmono-system-data4.0-cil # for rawr
libpcre2-dev # Rocker
libpng-dev # Rocker
libreadline-dev # Rocker
librsvg2-dev # for rsvg
libssl-dev # for openssl, mongolite
libtiff-dev # Rocker
libx11-dev
libxt-dev # Rocker
#mono-runtime # for rawr
#ocl-icd-opencl-dev # for gpuMagic
python3-minimal
zlib1g-dev # Rocker
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.
61 changes: 61 additions & 0 deletions src/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
#!/bin/bash

set -e

# Set variables
version="20.04"
repo="https://github.com/Bioconductor/BBS"
branch="master"
bbs="/tmp/BBS/Ubuntu-files/$version"
bioconductor_docker="/tmp/$version"
bbs_apt_files="apt_required_compile_R.txt apt_required_build.txt apt_bioc.txt apt_cran.txt"
bbs_pip_files="pip_pkgs.txt pip_spb.txt"

# Get repository with Ubuntu-files
if [ ! -d "/tmp/BBS" ]; then
git clone -b $branch --depth 1 $repo /tmp/BBS
fi

cd $bbs

# Write a sorted list of BBS apt packages, skipping any commented lines.
cat $bbs_apt_files | awk '/^[^#]/ {print $1}' | sort >> /tmp/bbs_apt_pkgs
# Write a sorted list of apt packages to remove from the install list,
# excluding any commented lines.
cat $bioconductor_docker/apt_skip.txt | awk '/^[^#]/ {print $1}' | sort >> /tmp/skip_apt_pkgs
# Write a file listing the apt packages to install, removing all packages
# in skip_apt_pkgs.
comm -23 /tmp/bbs_apt_pkgs /tmp/skip_apt_pkgs >> /tmp/install_apt_pkgs

# Write a file with pip packages to install.
cat $bbs_pip_files | awk '/^[^#]/ {print $1}' | sort >> /tmp/bbs_pip_pkgs
cat $bioconductor_docker/pip_skip.txt | awk '/^[^#]/ {print $1}' | sort >> /tmp/skip_pip_pkgs
comm -23 /tmp/bbs_pip_pkgs /tmp/skip_pip_pkgs >> /tmp/install_pip_pkgs

cd ~

# Packages always required by Bioconductor Docker
cat $bioconductor_docker/apt_required.txt | awk '/^[^#]/ {print $1}' >> /tmp/install_apt_pkgs
apt_pkgs=$(cat /tmp/install_apt_pkgs)
pip_pkgs=$(cat /tmp/install_pip_pkgs)

# Install dependencies

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

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

# Install pip packages
pip3 install $pip_pkgs
rm -rf ~/.cache/pip

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

0 comments on commit b82f00e

Please sign in to comment.