|
| 1 | +FROM ubuntu:bionic |
| 2 | + |
| 3 | +MAINTAINER Guillaume Flandin < [email protected]> |
| 4 | + |
| 5 | +RUN apt-get update \ |
| 6 | + && apt-get -y install unzip wget libxt6\ |
| 7 | + && apt-get clean \ |
| 8 | + && rm -rf \ |
| 9 | + /tmp/hsperfdata* \ |
| 10 | + /var/*/apt/*/partial \ |
| 11 | + /var/lib/apt/lists/* \ |
| 12 | + /var/log/apt/term* |
| 13 | + |
| 14 | +# Install MATLAB MCR in /opt/mcr/ |
| 15 | +# To save space we are removing all archives except Core and Numerics, and |
| 16 | +# we're kiling some of the larger blobs in the mcr as wel: Qt5 and cuda-related |
| 17 | +# libraries and map tiles. This list could be amended over time. |
| 18 | +ENV MATLAB_VERSION R2018b |
| 19 | +ENV MCR_VERSION v95 |
| 20 | +RUN mkdir /opt/mcr_install \ |
| 21 | + && mkdir /opt/mcr \ |
| 22 | + && 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 \ |
| 23 | + && unzip -q /opt/mcr_install/MCR_${MATLAB_VERSION}_glnxa64_installer.zip -d /opt/mcr_install \ |
| 24 | + && rm /opt/mcr_install/archives/*GPU* \ |
| 25 | + && rm /opt/mcr_install/archives/*Hadoop* \ |
| 26 | + && rm /opt/mcr_install/archives/*Java* \ |
| 27 | + && rm /opt/mcr_install/archives/*MPS* \ |
| 28 | + && rm /opt/mcr_install/archives/*NET* \ |
| 29 | + && rm /opt/mcr_install/archives/*Web_Apps* \ |
| 30 | + && /opt/mcr_install/install -destinationFolder /opt/mcr -agreeToLicense yes -mode silent \ |
| 31 | + && rm -rf /opt/mcr_install /tmp/* \ |
| 32 | + && rm -rf /opt/mcr/${MCR_VERSION}/bin/glnxa64/libQt5* \ |
| 33 | + && rm -rf /opt/mcr/${MCR_VERSION}/bin/glnxa64/qtwebengine* \ |
| 34 | + && rm -rf /opt/mcr/${MCR_VERSION}/mcr/toolbox/matlab/maps |
| 35 | + |
| 36 | +# Install SPM Standalone in /opt/spm12/ |
| 37 | +# Running spm once with "function exit" tests the succesfull installation *and* |
| 38 | +# extracts the ctf archive which is necessary if singularity is going to be |
| 39 | +# used later on, because singularity containers are read-only. |
| 40 | +ENV SPM_VERSION 12 |
| 41 | +ENV SPM_REVISION r7487 |
| 42 | +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 |
| 43 | +ENV MCR_INHIBIT_CTF_LOCK 1 |
| 44 | +ENV SPM_HTML_BROWSER 0 |
| 45 | +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 \ |
| 46 | + && unzip -q /opt/spm${SPM_VERSION}_${SPM_REVISION}_Linux_${MATLAB_VERSION}.zip -d /opt \ |
| 47 | + && rm -f /opt/spm${SPM_VERSION}_${SPM_REVISION}_Linux_${MATLAB_VERSION}.zip \ |
| 48 | + && /opt/spm${SPM_VERSION}/spm${SPM_VERSION} function exit |
| 49 | + |
| 50 | +# The container might not be run with uid 0 |
| 51 | +RUN chmod +x /opt/spm12/spm12 |
| 52 | + |
| 53 | +# Configure entry point |
| 54 | +ENTRYPOINT ["/opt/spm12/spm12"] |
| 55 | +CMD ["--help"] |
0 commit comments