-
Notifications
You must be signed in to change notification settings - Fork 17
/
Dockerfile
46 lines (40 loc) · 2.19 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
FROM ubuntu:22.04
LABEL org.opencontainers.image.authors="SPM <fil.spm@ucl.ac.uk>"
LABEL org.opencontainers.image.source="https://github.com/WCHN/CTseg"
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install \
unzip xorg wget \
&& apt-get clean \
&& rm -rf \
/tmp/hsperfdata* \
/var/*/apt/*/partial \
/var/lib/apt/lists/* \
/var/log/apt/term*
# Install MATLAB MCR in /opt/mcr/
ENV MATLAB_VERSION R2019b
ENV MCR_VERSION v97
ENV MCR_UPDATE 9
RUN mkdir /opt/mcr_install \
&& mkdir /opt/mcr \
&& wget --progress=bar:force -P /opt/mcr_install https://ssd.mathworks.com/supportfiles/downloads/${MATLAB_VERSION}/Release/${MCR_UPDATE}/deployment_files/installer/complete/glnxa64/MATLAB_Runtime_${MATLAB_VERSION}_Update_${MCR_UPDATE}_glnxa64.zip \
&& unzip -q /opt/mcr_install/MATLAB_Runtime_${MATLAB_VERSION}_Update_${MCR_UPDATE}_glnxa64.zip -d /opt/mcr_install \
&& /opt/mcr_install/install -destinationFolder /opt/mcr -agreeToLicense yes -mode silent \
&& rm -rf /opt/mcr_install /tmp/*
# Install SPM Standalone in /opt/spm12/
ENV SPM_REVISION latest
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:/opt/mcr/${MCR_VERSION}/extern/bin/glnxa64
ENV MCR_INHIBIT_CTF_LOCK 1
ENV SPM_HTML_BROWSER 0
# 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.
# Also, set +x on the entrypoint for non-root container invocations
RUN wget --no-check-certificate --progress=bar:force -P /opt https://www.fil.ion.ucl.ac.uk/spm/download/restricted/utopia/dev/tbx/spm_${SPM_REVISION}_tbx_Linux_${MATLAB_VERSION}.zip \
&& unzip -q /opt/spm_${SPM_REVISION}_tbx_Linux_${MATLAB_VERSION}.zip -d /opt \
&& rm -f /opt/spm_${SPM_REVISION}_tbx_Linux_${MATLAB_VERSION}.zip \
&& /opt/spm/spm function exit \
&& chmod +x /opt/spm/spm
# Check that CTseg model files are installed and download them otherwise
RUN /opt/spm/spm eval "try,spm_CTseg(1);end"
# Configure entry point
ENTRYPOINT ["/opt/spm/spm"]
CMD ["--help"]