Skip to content

Commit 40948b5

Browse files
committed
Move dependencies out of Dockerfile
- Add bin/install.sh to install BBS dependencies - Add Ubuntu-files to track docker-specific dependencies - Move install.R to bin
1 parent 867d099 commit 40948b5

File tree

7 files changed

+158
-123
lines changed

7 files changed

+158
-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=2
10+
ARG BIOCONDUCTOR_PATCH=3
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-
## Databases and other software
102-
sqlite \
103-
openmpi-bin \
104-
mpi-default-bin \
105-
openmpi-common \
106-
openmpi-doc \
107-
tcl8.6-dev \
108-
tk-dev \
109-
default-jdk \
110-
imagemagick \
111-
tabix \
112-
ggobi \
113-
graphviz \
114-
protobuf-compiler \
115-
jags \
116-
## Additional resources
117-
xfonts-100dpi \
118-
xfonts-75dpi \
119-
biber \
120-
libsbml5-dev \
121-
libzmq3-dev \
122-
&& apt-get clean \
123-
&& rm -rf /var/lib/apt/lists/*
32+
COPY bin /tmp
33+
COPY Ubuntu-files /tmp
12434

125-
## Python installations
126-
RUN apt-get update \
127-
&& apt-get install -y software-properties-common \
128-
&& add-apt-repository universe \
129-
&& apt-get update \
130-
&& apt-get -y --no-install-recommends install python2 python-dev \
131-
&& curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output get-pip.py \
132-
&& python2 get-pip.py \
133-
&& pip2 install wheel \
134-
## Install sklearn and pandas on python
135-
&& pip2 install sklearn \
136-
pandas \
137-
pyyaml \
138-
cwltool \
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 /bin/bash -C /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: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# APT required
2+
byacc
3+
curl
4+
default-libmysqlclient-dev
5+
fortran77-compiler
6+
ggobi
7+
imagemagick
8+
libapparmor-dev
9+
libarchive-extract-perl
10+
libbz2-dev
11+
libcgi-pm-perl
12+
libdbd-mysql-perl
13+
libdbi-perl
14+
libfile-copy-recursive-perl
15+
libgl1-mesa-dev
16+
libgmp3-dev
17+
libgsl0-dev
18+
libgslcblas0
19+
libhdf5-dev
20+
libhdf5-serial-dev
21+
libjpeg8-dev
22+
libjpeg-turbo8-dev
23+
liblapack-dev
24+
#libmariadb-dev-compat # Depends on libmariadb-dev, conflicts with libmysqlclient-dev
25+
libmodule-build-perl
26+
libncurses-dev
27+
libopenmpi-dev
28+
libperl-dev
29+
libprotoc-dev
30+
librdf0-dev
31+
libtiff5-dev
32+
libxml-simple-perl
33+
libxpm-dev
34+
libz-dev
35+
libzmq3-dev
36+
mpi-default-bin
37+
openmpi-bin
38+
openmpi-common
39+
openmpi-doc
40+
pkg-config
41+
software-properties-common
42+
sqlite
43+
tabix
44+
tcl8.6-dev

Ubuntu-files/20.04/apt_skip.txt

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# APT skip
2+
build-essential
3+
clustalo
4+
fuse
5+
gfortran
6+
git
7+
gobjc
8+
gsfonts-x11
9+
infernal
10+
kallisto
11+
libavfilter-dev
12+
libcurl4-openssl-dev
13+
libeigen3-dev
14+
libfribidi-dev
15+
libfuse-dev
16+
libgmp-dev # BD uses libgmp3-dev
17+
libgraphviz-dev
18+
libgsl-dev # BD uses libgsl0-dev
19+
libicu-dev
20+
librsvg2-dev
21+
libssl-dev
22+
libtiff-dev # BD uses libtiff5-dev
23+
libx11-dev
24+
manpages-dev
25+
mlocate
26+
mpi-default-dev # BD uses mpi-default-bin
27+
ocl-icd-opencl-dev
28+
pandoc
29+
pandoc-citeproc
30+
t1-xfree86-nonfree
31+
tcl-dev # BD uses tcl8.6-dev
32+
texi2html
33+
texinfo
34+
texlive
35+
texlive-bibtex-extra
36+
texlive-fonts-extra
37+
texlive-font-utils
38+
texlive-lang-european
39+
texlive-latex-extra
40+
texlive-luatex
41+
texlive-pstricks
42+
texlive-science
43+
tree
44+
ttf-xfree86-nonfree
45+
ttf-xfree86-nonfree-syriac
46+
xfonts-base # BD uses xfonts-100dpi and xfonts-75dpi
47+
xfonts-scalable
48+
zlib1g-dev

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

bin/.install.sh.swp

12 KB
Binary file not shown.

install.R renamed to bin/install.R

File renamed without changes.

bin/install.sh

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
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_files="/tmp/BBS/Ubuntu-files/$version"
10+
bd_files="/tmp/$version"
11+
12+
# Get repository with Ubuntu-files
13+
if [ ! -d "/tmp/BBS" ]; then
14+
git clone $repo /tmp/BBS
15+
cd /tmp/BBS
16+
if [ $branch != "master" ]; then
17+
git fetch origin $branch
18+
git switch $branch
19+
fi
20+
cd ~
21+
fi
22+
23+
# Constructing array of apt packages, removing unnecessary packages.
24+
cat $bbs_files/apt_*.txt | awk '/^[^#]/ {print $1}' | sort >> /tmp/bbs_apt_pkgs
25+
cat $bd_files/apt_*.txt | awk '/^[^#]/ {print $1}' | sort >> /tmp/skip_apt_pkgs
26+
apt_pkgs=$(comm -23 /tmp/bbs_apt_pkgs /tmp/skip_apt_pkgs)
27+
28+
# Constructing array of pip packages, removing unnecessary packages.
29+
cat $bbs_files/pip_*.txt | awk '/^[^#]/ {print $1}' | sort >> /tmp/bbs_pip_pkgs
30+
cat $bd_files/pip_*.txt | awk '/^[^#]/ {print $1}' | sort >> /tmp/skip_pip_pkgs
31+
pip_pkgs=$(comm -23 /tmp/bbs_pip_pkgs /tmp/skip_pip_pkgs)
32+
33+
# Packages always required by Bioconductor Docker
34+
apt_required_pkgs=$(cat $bd_files/apt_required.txt | awk '/^[^#]/ {print $1}')
35+
36+
# Install dependencies
37+
38+
# Install apt packages
39+
apt-get update \
40+
&& apt-get install -y --no-install-recommends apt-utils
41+
42+
apt-get update \
43+
&& apt-get install -y --no-install-recommends $apt_pkgs
44+
45+
apt-get update \
46+
&& apt-get install -y --no-install-recommends $apt_required_pkgs \
47+
&& apt-get clean && rm -rf /var/lib/apt/lists/*
48+
49+
# Install pip packages
50+
pip3 install $pip_pkgs
51+
52+
# Remove files
53+
if test -n "$(find /tmp -maxdepth 1 -name '*_pkgs' -print -quit)"; then
54+
rm /tmp/*_pkgs
55+
fi

0 commit comments

Comments
 (0)