Skip to content

Commit d732eb7

Browse files
committed
Make installation explicit
- Add comments to demystify package selection/removal - Remove extraneous apt packages
1 parent 9f799a4 commit d732eb7

File tree

6 files changed

+72
-146
lines changed

6 files changed

+72
-146
lines changed

Dockerfile

Lines changed: 3 additions & 3 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=5
10+
ARG BIOCONDUCTOR_PATCH=11
1111
ARG BIOCONDUCTOR_DOCKER_VERSION=${BIOCONDUCTOR_VERSION}.${BIOCONDUCTOR_PATCH}
1212

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

32-
COPY bin /tmp
32+
COPY src /tmp
3333
COPY Ubuntu-files /tmp
3434

3535
# Install dependencies
36-
RUN /bin/bash -C /tmp/install.sh
36+
RUN bash /tmp/install.sh
3737

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

Ubuntu-files/20.04/apt_required.txt

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,3 @@
11
# APT required
2-
byacc
32
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
353
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: 10 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,11 @@
11
# 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
2+
gfortran # Rocker
3+
libbz2-dev # Rocker
4+
libcurl4 # Rocker
5+
libicui-dev # Rocker
6+
libpcre2-dev # Rocker
7+
libjpeg-dev # Rocker uses libjpeg-turbo*
8+
libreadline-dev # Rocker
9+
libtiff-dev # Rocker
10+
liblzma-dev # Rocker
11+
zlib1g-dev # Rocker

bin/install.sh

Lines changed: 0 additions & 55 deletions
This file was deleted.
File renamed without changes.

src/install.sh

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
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_bioc.txt apt_cran.txt apt_extra_fonts.txt apt_nice_to_have.txt apt_optional_compile_R.txt apt_required_build.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+
rm /tmp/*_pkgs
58+
rm -rf /tmp/BBS
59+
fi

0 commit comments

Comments
 (0)