From 9e21b1fc28d8f1eab0b88c571e69e6301e509f52 Mon Sep 17 00:00:00 2001 From: Michael Krause Date: Thu, 23 May 2019 09:44:22 +0200 Subject: [PATCH] Add "slim" version + wipe some matlab archives before installation + remove some GUI-related and GPGPU related libraries + remove map tiles --- matlab/slim/Dockerfile | 55 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 matlab/slim/Dockerfile diff --git a/matlab/slim/Dockerfile b/matlab/slim/Dockerfile new file mode 100644 index 0000000..1ccfe0c --- /dev/null +++ b/matlab/slim/Dockerfile @@ -0,0 +1,55 @@ +FROM ubuntu:bionic + +MAINTAINER Guillaume Flandin + +RUN apt-get update \ + && apt-get -y install unzip wget libxt6\ + && apt-get clean \ + && rm -rf \ + /tmp/hsperfdata* \ + /var/*/apt/*/partial \ + /var/lib/apt/lists/* \ + /var/log/apt/term* + +# Install MATLAB MCR in /opt/mcr/ +# To save space we are removing all archives except Core and Numerics, and +# we're kiling some of the larger blobs in the mcr as wel: Qt5 and cuda-related +# libraries and map tiles. This list could be amended over time. +ENV MATLAB_VERSION R2018b +ENV MCR_VERSION v95 +RUN mkdir /opt/mcr_install \ + && mkdir /opt/mcr \ + && wget -P /opt/mcr_install https://www.mathworks.com/supportfiles/downloads/${MATLAB_VERSION}/deployment_files/${MATLAB_VERSION}/installers/glnxa64/MCR_${MATLAB_VERSION}_glnxa64_installer.zip \ + && unzip -q /opt/mcr_install/MCR_${MATLAB_VERSION}_glnxa64_installer.zip -d /opt/mcr_install \ + && rm /opt/mcr_install/archives/*GPU* \ + && rm /opt/mcr_install/archives/*Hadoop* \ + && rm /opt/mcr_install/archives/*Java* \ + && rm /opt/mcr_install/archives/*MPS* \ + && rm /opt/mcr_install/archives/*NET* \ + && rm /opt/mcr_install/archives/*Web_Apps* \ + && /opt/mcr_install/install -destinationFolder /opt/mcr -agreeToLicense yes -mode silent \ + && rm -rf /opt/mcr_install /tmp/* \ + && rm -rf /opt/mcr/${MCR_VERSION}/bin/glnxa64/libQt5* \ + && rm -rf /opt/mcr/${MCR_VERSION}/bin/glnxa64/qtwebengine* \ + && rm -rf /opt/mcr/${MCR_VERSION}/mcr/toolbox/matlab/maps + +# Install SPM Standalone in /opt/spm12/ +# Running spm once with "function exit" tests the succesfull installation *and* +# extracts the ctf archive which is necessary if singularity is going to be +# used later on, because singularity containers are read-only. +ENV SPM_VERSION 12 +ENV SPM_REVISION r7487 +ENV LD_LIBRARY_PATH /opt/mcr/${MCR_VERSION}/runtime/glnxa64:/opt/mcr/${MCR_VERSION}/bin/glnxa64:/opt/mcr/${MCR_VERSION}/sys/os/glnxa64:/opt/mcr/${MCR_VERSION}/sys/opengl/lib/glnxa64 +ENV MCR_INHIBIT_CTF_LOCK 1 +ENV SPM_HTML_BROWSER 0 +RUN wget --no-check-certificate -P /opt https://www.fil.ion.ucl.ac.uk/spm/download/restricted/bids/spm${SPM_VERSION}_${SPM_REVISION}_Linux_${MATLAB_VERSION}.zip \ + && unzip -q /opt/spm${SPM_VERSION}_${SPM_REVISION}_Linux_${MATLAB_VERSION}.zip -d /opt \ + && rm -f /opt/spm${SPM_VERSION}_${SPM_REVISION}_Linux_${MATLAB_VERSION}.zip \ + && /opt/spm${SPM_VERSION}/spm${SPM_VERSION} function exit + +# The container might not be run with uid 0 +RUN chmod +x /opt/spm12/spm12 + +# Configure entry point +ENTRYPOINT ["/opt/spm12/spm12"] +CMD ["--help"]