diff --git a/Dockerfile b/Dockerfile index 3129d1a..b403e2d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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=2 +ARG BIOCONDUCTOR_PATCH=5 ARG BIOCONDUCTOR_DOCKER_VERSION=${BIOCONDUCTOR_VERSION}.${BIOCONDUCTOR_PATCH} LABEL name="bioconductor/bioconductor_docker" \ @@ -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 \ - ## 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 bin /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 \ - cwltool \ - && 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 /bin/bash -C /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 diff --git a/Ubuntu-files/20.04/apt_required.txt b/Ubuntu-files/20.04/apt_required.txt new file mode 100644 index 0000000..58cff70 --- /dev/null +++ b/Ubuntu-files/20.04/apt_required.txt @@ -0,0 +1,44 @@ +# APT required +byacc +curl +default-libmysqlclient-dev +fortran77-compiler +ggobi +imagemagick +libapparmor-dev +libarchive-extract-perl +libbz2-dev +libcgi-pm-perl +libdbd-mysql-perl +libdbi-perl +libfile-copy-recursive-perl +libgl1-mesa-dev +libgmp3-dev +libgsl0-dev +libgslcblas0 +libhdf5-dev +libhdf5-serial-dev +libjpeg8-dev +libjpeg-turbo8-dev +liblapack-dev +#libmariadb-dev-compat # Depends on libmariadb-dev, conflicts with libmysqlclient-dev +libmodule-build-perl +libncurses-dev +libopenmpi-dev +libperl-dev +libprotoc-dev +librdf0-dev +libtiff5-dev +libxml-simple-perl +libxpm-dev +libz-dev +libzmq3-dev +mpi-default-bin +openmpi-bin +openmpi-common +openmpi-doc +pkg-config +software-properties-common +sqlite +tabix +tcl8.6-dev diff --git a/Ubuntu-files/20.04/apt_skip.txt b/Ubuntu-files/20.04/apt_skip.txt new file mode 100644 index 0000000..82c66c8 --- /dev/null +++ b/Ubuntu-files/20.04/apt_skip.txt @@ -0,0 +1,48 @@ +# APT skip +build-essential +clustalo +fuse +gfortran +git +gobjc +gsfonts-x11 +infernal +kallisto +libavfilter-dev +libcurl4-openssl-dev +libeigen3-dev +libfribidi-dev +libfuse-dev +libgmp-dev # BD uses libgmp3-dev +libgraphviz-dev +libgsl-dev # BD uses libgsl0-dev +libicu-dev +librsvg2-dev +libssl-dev +libtiff-dev # BD uses libtiff5-dev +libx11-dev +manpages-dev +mlocate +mpi-default-dev # BD uses mpi-default-bin +ocl-icd-opencl-dev +pandoc +pandoc-citeproc +t1-xfree86-nonfree +tcl-dev # BD uses tcl8.6-dev +texi2html +texinfo +texlive +texlive-bibtex-extra +texlive-fonts-extra +texlive-font-utils +texlive-lang-european +texlive-latex-extra +texlive-luatex +texlive-pstricks +texlive-science +tree +ttf-xfree86-nonfree +ttf-xfree86-nonfree-syriac +xfonts-base # BD uses xfonts-100dpi and xfonts-75dpi +xfonts-scalable +zlib1g-dev diff --git a/Ubuntu-files/20.04/pip_skip.txt b/Ubuntu-files/20.04/pip_skip.txt new file mode 100644 index 0000000..d22f83d --- /dev/null +++ b/Ubuntu-files/20.04/pip_skip.txt @@ -0,0 +1,6 @@ +cwltool +pandas +pyyaml +sklearn +tensorflow +wheel diff --git a/install.R b/bin/install.R similarity index 100% rename from install.R rename to bin/install.R diff --git a/bin/install.sh b/bin/install.sh new file mode 100644 index 0000000..a2091af --- /dev/null +++ b/bin/install.sh @@ -0,0 +1,55 @@ +#!/bin/bash + +set -e + +# Set variables +version="20.04" +repo="https://github.com/Bioconductor/bbs" +branch="master" +bbs_files="/tmp/BBS/Ubuntu-files/$version" +bd_files="/tmp/$version" + +# Get repository with Ubuntu-files +if [ ! -d "/tmp/BBS" ]; then + git clone $repo /tmp/BBS + cd /tmp/BBS + if [ $branch != "master" ]; then + git fetch origin $branch + git switch $branch + fi + cd ~ +fi + +# Constructing array of apt packages, removing unnecessary packages. +cat $bbs_files/apt_*.txt | awk '/^[^#]/ {print $1}' | sort >> /tmp/bbs_apt_pkgs +cat $bd_files/apt_*.txt | awk '/^[^#]/ {print $1}' | sort >> /tmp/skip_apt_pkgs +apt_pkgs=$(comm -23 /tmp/bbs_apt_pkgs /tmp/skip_apt_pkgs) + +# Constructing array of pip packages, removing unnecessary packages. +cat $bbs_files/pip_*.txt | awk '/^[^#]/ {print $1}' | sort >> /tmp/bbs_pip_pkgs +cat $bd_files/pip_*.txt | awk '/^[^#]/ {print $1}' | sort >> /tmp/skip_pip_pkgs +pip_pkgs=$(comm -23 /tmp/bbs_pip_pkgs /tmp/skip_pip_pkgs) + +# Packages always required by Bioconductor Docker +apt_required_pkgs=$(cat $bd_files/apt_required.txt | awk '/^[^#]/ {print $1}') + +# Install dependencies + +# Install apt packages +apt-get update \ + && apt-get install -y --no-install-recommends apt-utils + +apt-get update \ + && apt-get install -y --no-install-recommends $apt_pkgs + +apt-get update \ + && apt-get install -y --no-install-recommends $apt_required_pkgs \ + && apt-get clean && rm -rf /var/lib/apt/lists/* + +# Install pip packages +pip3 install $pip_pkgs + +# Remove files +if test -n "$(find /tmp -maxdepth 1 -name '*_pkgs' -print -quit)"; then + rm /tmp/*_pkgs +fi