-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathDockerfile
46 lines (40 loc) · 2.18 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 <[email protected]>"
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 R2021b
ENV MCR_VERSION v911
ENV MCR_UPDATE 7
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 r8168
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
ADD https://www.dropbox.com/scl/fi/n8hssv9qbtoq1jit5nntp/spm12_${SPM_REVISION}_BI_Linux_${MATLAB_VERSION}.zip?rlkey=xy3e4miuil2qyafkov35iyca5&st=gcplemhq&dl=1 /opt
RUN unzip -q /opt/spm12_${SPM_REVISION}_BI_Linux_${MATLAB_VERSION}.zip -d /opt \
&& rm -f /opt/spm12_${SPM_REVISION}_BI_Linux_${MATLAB_VERSION}.zip \
&& /opt/spm12/spm12 function exit \
&& chmod +x /opt/spm12/spm12
# Check that CTseg model files are installed and download them otherwise
RUN /opt/spm12/spm12 eval "try,spm_CTseg(1);end"
# Configure entry
ENTRYPOINT ["/opt/spm12/spm12"]
CMD ["--help"]