Skip to content

Commit

Permalink
Add "slim" version
Browse files Browse the repository at this point in the history
+ wipe some matlab archives before installation
+ remove some GUI-related and GPGPU related libraries
+ remove map tiles
  • Loading branch information
octomike committed May 23, 2019
1 parent 5e0c0f1 commit 9e21b1f
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions matlab/slim/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
FROM ubuntu:bionic

MAINTAINER Guillaume Flandin <g.flandin@ucl.ac.uk>

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"]

0 comments on commit 9e21b1f

Please sign in to comment.