Skip to content

Commit b82f00e

Browse files
committed
Move dependences out of Dockerfile
- Add packages already installed via Rocker to skip file - Move scripts to src - Add comments to src/install.sh
1 parent dafcfd4 commit b82f00e

File tree

6 files changed

+110
-123
lines changed

6 files changed

+110
-123
lines changed

Dockerfile

Lines changed: 5 additions & 123 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ARG BIOCONDUCTOR_VERSION=3.14
77
##### IMPORTANT ########
88
## The PATCH version number should be incremented each time
99
## there is a change in the Dockerfile.
10-
ARG BIOCONDUCTOR_PATCH=17
10+
ARG BIOCONDUCTOR_PATCH=18
1111
ARG BIOCONDUCTOR_DOCKER_VERSION=${BIOCONDUCTOR_VERSION}.${BIOCONDUCTOR_PATCH}
1212

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

32-
# Update apt-get
33-
RUN apt-get update \
34-
&& apt-get install -y --no-install-recommends apt-utils \
35-
&& apt-get install -y --no-install-recommends \
36-
## Basic deps
37-
gdb \
38-
libxml2-dev \
39-
python3-pip \
40-
libz-dev \
41-
liblzma-dev \
42-
libbz2-dev \
43-
libpng-dev \
44-
libgit2-dev \
45-
## sys deps from bioc_full
46-
pkg-config \
47-
fortran77-compiler \
48-
byacc \
49-
automake \
50-
curl \
51-
## This section installs libraries
52-
libpcre2-dev \
53-
libnetcdf-dev \
54-
libhdf5-serial-dev \
55-
libfftw3-dev \
56-
libopenbabel-dev \
57-
libopenmpi-dev \
58-
libxt-dev \
59-
libudunits2-dev \
60-
libgeos-dev \
61-
libproj-dev \
62-
libcairo2-dev \
63-
libtiff5-dev \
64-
libreadline-dev \
65-
libgsl0-dev \
66-
libgslcblas0 \
67-
libgtk2.0-dev \
68-
libgl1-mesa-dev \
69-
libglu1-mesa-dev \
70-
libgmp3-dev \
71-
libhdf5-dev \
72-
libncurses-dev \
73-
libbz2-dev \
74-
libxpm-dev \
75-
liblapack-dev \
76-
libv8-dev \
77-
libgtkmm-2.4-dev \
78-
libmpfr-dev \
79-
libmodule-build-perl \
80-
libapparmor-dev \
81-
libprotoc-dev \
82-
librdf0-dev \
83-
libmagick++-dev \
84-
libsasl2-dev \
85-
libpoppler-cpp-dev \
86-
libprotobuf-dev \
87-
libpq-dev \
88-
libperl-dev \
89-
## software - perl extentions and modules
90-
libarchive-extract-perl \
91-
libfile-copy-recursive-perl \
92-
libcgi-pm-perl \
93-
libdbi-perl \
94-
libdbd-mysql-perl \
95-
libxml-simple-perl \
96-
libmysqlclient-dev \
97-
default-libmysqlclient-dev \
98-
libgdal-dev \
99-
## new libs
100-
libglpk-dev \
101-
libeigen3-dev \
102-
## Databases and other software
103-
sqlite \
104-
openmpi-bin \
105-
mpi-default-bin \
106-
openmpi-common \
107-
openmpi-doc \
108-
tcl8.6-dev \
109-
tk-dev \
110-
default-jdk \
111-
imagemagick \
112-
tabix \
113-
ggobi \
114-
graphviz \
115-
protobuf-compiler \
116-
jags \
117-
## Additional resources
118-
xfonts-100dpi \
119-
xfonts-75dpi \
120-
biber \
121-
libsbml5-dev \
122-
libzmq3-dev \
123-
&& apt-get clean \
124-
&& rm -rf /var/lib/apt/lists/*
32+
COPY src /tmp
33+
COPY Ubuntu-files /tmp
12534

126-
## Python installations
127-
RUN apt-get update \
128-
&& apt-get install -y software-properties-common \
129-
&& add-apt-repository universe \
130-
&& apt-get update \
131-
&& apt-get -y --no-install-recommends install python2 python-dev \
132-
&& curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output get-pip.py \
133-
&& python2 get-pip.py \
134-
&& pip2 install wheel \
135-
## Install sklearn and pandas on python
136-
&& pip2 install sklearn \
137-
pandas \
138-
pyyaml \
139-
&& apt-get clean \
140-
&& rm -rf /var/lib/apt/lists/* \
141-
&& rm -rf get-pip.py
142-
143-
## FIXME
144-
## These two libraries don't install in the above section--WHY?
145-
RUN apt-get update \
146-
&& apt-get -y --no-install-recommends install \
147-
libmariadb-dev-compat \
148-
libjpeg-dev \
149-
libjpeg-turbo8-dev \
150-
libjpeg8-dev \
151-
&& apt-get clean \
152-
&& rm -rf /var/lib/apt/lists/*
35+
# Install dependencies
36+
RUN bash /tmp/install.sh
15337

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

157-
ADD install.R /tmp/
158-
15941
RUN R -f /tmp/install.R
16042

16143
# DEVEL: Add sys env variables to DEVEL image

Ubuntu-files/20.04/apt_required.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# APT required
2+
curl
3+
libzmq3-dev
4+
python3-pip

Ubuntu-files/20.04/apt_skip.txt

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# APT skip
2+
build-essential
3+
clustalo # for LowMACA
4+
default-jdk # Rocker
5+
firefox # for packages using utils::browseURL()
6+
#fuse # for Travel
7+
gfortran # Rocker
8+
git
9+
gobjc
10+
infernal # for inferrnal
11+
kallisto # for rkal
12+
#libavfilter-dev # for av/spacialHeatmap
13+
libbz2-dev # Rocker
14+
libcairo2-dev # Rocker
15+
libcurl4-openssl-dev # Rocker
16+
libfribidi-dev # for EnhancedVolcano--is this still needed?
17+
#libfuse-dev # for Travel
18+
libgraphviz-dev # for Rgraphviz
19+
libicu-dev # Rocker
20+
libjpeg-dev # Rocker
21+
liblzma-dev # Rocker
22+
#libmono-system-data4.0-cil # for rawr
23+
libpcre2-dev # Rocker
24+
libpng-dev # Rocker
25+
libreadline-dev # Rocker
26+
librsvg2-dev # for rsvg
27+
libssl-dev # for openssl, mongolite
28+
libtiff-dev # Rocker
29+
libx11-dev
30+
libxt-dev # Rocker
31+
#mono-runtime # for rawr
32+
#ocl-icd-opencl-dev # for gpuMagic
33+
python3-minimal
34+
zlib1g-dev # Rocker

Ubuntu-files/20.04/pip_skip.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
cwltool
2+
pandas
3+
pyyaml
4+
sklearn
5+
tensorflow
6+
wheel

install.R renamed to src/install.R

File renamed without changes.

src/install.sh

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
# Set variables
6+
version="20.04"
7+
repo="https://github.com/Bioconductor/BBS"
8+
branch="master"
9+
bbs="/tmp/BBS/Ubuntu-files/$version"
10+
bioconductor_docker="/tmp/$version"
11+
bbs_apt_files="apt_required_compile_R.txt apt_required_build.txt apt_bioc.txt apt_cran.txt"
12+
bbs_pip_files="pip_pkgs.txt pip_spb.txt"
13+
14+
# Get repository with Ubuntu-files
15+
if [ ! -d "/tmp/BBS" ]; then
16+
git clone -b $branch --depth 1 $repo /tmp/BBS
17+
fi
18+
19+
cd $bbs
20+
21+
# Write a sorted list of BBS apt packages, skipping any commented lines.
22+
cat $bbs_apt_files | awk '/^[^#]/ {print $1}' | sort >> /tmp/bbs_apt_pkgs
23+
# Write a sorted list of apt packages to remove from the install list,
24+
# excluding any commented lines.
25+
cat $bioconductor_docker/apt_skip.txt | awk '/^[^#]/ {print $1}' | sort >> /tmp/skip_apt_pkgs
26+
# Write a file listing the apt packages to install, removing all packages
27+
# in skip_apt_pkgs.
28+
comm -23 /tmp/bbs_apt_pkgs /tmp/skip_apt_pkgs >> /tmp/install_apt_pkgs
29+
30+
# Write a file with pip packages to install.
31+
cat $bbs_pip_files | awk '/^[^#]/ {print $1}' | sort >> /tmp/bbs_pip_pkgs
32+
cat $bioconductor_docker/pip_skip.txt | awk '/^[^#]/ {print $1}' | sort >> /tmp/skip_pip_pkgs
33+
comm -23 /tmp/bbs_pip_pkgs /tmp/skip_pip_pkgs >> /tmp/install_pip_pkgs
34+
35+
cd ~
36+
37+
# Packages always required by Bioconductor Docker
38+
cat $bioconductor_docker/apt_required.txt | awk '/^[^#]/ {print $1}' >> /tmp/install_apt_pkgs
39+
apt_pkgs=$(cat /tmp/install_apt_pkgs)
40+
pip_pkgs=$(cat /tmp/install_pip_pkgs)
41+
42+
# Install dependencies
43+
44+
# Install apt packages
45+
apt-get update \
46+
&& apt-get install -y --no-install-recommends apt-utils
47+
48+
apt-get install -y --no-install-recommends $apt_pkgs \
49+
&& apt-get clean && rm -rf /var/lib/apt/lists/*
50+
51+
# Install pip packages
52+
pip3 install $pip_pkgs
53+
rm -rf ~/.cache/pip
54+
55+
# Remove files
56+
if test -n "$(find /tmp -maxdepth 1 -name '*_pkgs' -print -quit)"; then
57+
cd /tmp
58+
rm bbs_apt_files bbs_pip_files
59+
rm -rf BBS
60+
cd
61+
fi

0 commit comments

Comments
 (0)