Closed lyndonboone closed 4 months ago
Hi @lyndonboone
I had a quick look at your issue and it appears that the dev-version zip file that is linked in the Dockerfile does not contain the SPM standalone binary hence why you get the 'not found' error. I have no idea about the different versions of SPM and what you are planning on doing with it but I modified the Dockerfile to install SPM12 version r7771
for MATLAB R2019b
and it's working on maghz
. This version might work in the WSL2
as well.
Here's the modified Dockerfile:
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_VERSION r7771
ENV OS_VERSION Linux
ENV SPM_ZIP spm12_${SPM_VERSION}_${OS_VERSION}_${MATLAB_VERSION}.zip
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/spm12/${SPM_ZIP} \
&& unzip -q /opt/${SPM_ZIP} -d /opt \
&& rm -f /opt/${SPM_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 point
ENTRYPOINT ["/opt/spm12/spm12"]
CMD ["--help"]
Just build it with docker build -t spm12:r7771 .
from the directory the Dockerfile is in and execute with e.g. docker run -it --rm spm12:r7771 -v
.
@brudfors I don't know what the intentions were with the Dockerfile re: the version of SPM but I saw SPM12 referenced in a comment in the Dockerfile. Lmk if this would be a useful fix for the repo and I'll open a PR for it. Would it otherwise be a viable option to just add the dev standalone binary to the dev version zips?
Cheers!
Thank you for reporting @lyndonboone. I just pushed a fix to the Dockerfile
, could you please try and see if it resolved your issue?
Thanks for looking at this @jono3030. The SPM binaries that you proposed using does unfortunately not contain the CTseg application. I pushed a fix that uses a version of SPM that does (and changed where it is being hosted).
Thanks a million @jono3030 and @brudfors !! I just retried after pulling the new fix and it appears to be running on our maghz
linux server and WSL2.
Hi there,
I'm trying to build a Docker image from the CTseg Dockerfile in WSL2 version 20.04. When I execute
docker build -t ubuntu:ctseg -f CTseg/Dockerfile .
I get the following error:Do you know if there's anything I can do to get around this error? Is the CTseg Docker image compatible with WSL2? Thanks so much for all your help!