Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move dependencies out of Dockerfile #32

Open
wants to merge 2 commits into
base: devel
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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=19
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
20 changes: 20 additions & 0 deletions Ubuntu-files/20.04/apt_skip.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# APT skip
build-essential
default-jdk # Rocker
gfortran # Rocker
git
gobjc
libbz2-dev # Rocker
libcairo2-dev # Rocker
libcurl4-openssl-dev # Rocker
libicu-dev # Rocker
libjpeg-dev # Rocker
liblzma-dev # Rocker
libpcre2-dev # Rocker
libpng-dev # Rocker
libreadline-dev # Rocker
libtiff-dev # Rocker
libx11-dev
libxt-dev # Rocker
python3-minimal
zlib1g-dev # Rocker
5 changes: 5 additions & 0 deletions Ubuntu-files/20.04/pip_skip.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pandas
pyyaml
sklearn
tensorflow
wheel
File renamed without changes.
60 changes: 60 additions & 0 deletions src/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#!/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 apt_optional_compile_R.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

# Packages to install
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
rm -rf /tmp/BBS /tmp/*_pkgs /tmp/20.04
fi