From b9850fdcb7b6bf7684e75778d77edc6e6879363b Mon Sep 17 00:00:00 2001 From: David Meunier Date: Wed, 20 Mar 2024 15:17:10 +0100 Subject: [PATCH 1/2] macapype_env 0.2 and 0.2-spm --- Dockerfile_macapype_env | 50 +++++++++++++++++++++++++++-------- Dockerfile_macapype_env_nomcr | 29 ++++++++++++++++++++ Dockerfile_nomcr | 2 +- Dockerfile_testpypi_nomcr | 2 +- 4 files changed, 70 insertions(+), 13 deletions(-) diff --git a/Dockerfile_macapype_env b/Dockerfile_macapype_env index bb243b0c..baa1d8e3 100644 --- a/Dockerfile_macapype_env +++ b/Dockerfile_macapype_env @@ -132,7 +132,6 @@ RUN apt-get install -y -q --no-install-recommends \ tcsh \ xfonts-base \ xvfb - RUN curl -sSL --retry 5 -o /tmp/toinstall.deb http://snapshot.debian.org/archive/debian-security/20160113T213056Z/pool/updates/main/libp/libpng/libpng12-0_1.2.49-1%2Bdeb7u2_amd64.deb RUN dpkg -i /tmp/toinstall.deb RUN rm /tmp/toinstall.deb @@ -163,6 +162,45 @@ RUN echo "Downloading ANTs ..." \ && curl -fsSL --retry 5 https://dl.dropbox.com/s/1xfhydsf4t4qoxg/ants-Linux-centos6_x86_64-v2.3.1.tar.gz \ | tar -xz -C /opt/ants-2.3.1 --strip-components 1 +######################## NiftiReg +RUN apt-get install --yes --no-install-recommends \ + ca-certificates cmake gcc g++ git make \ + && git clone https://github.com/KCL-BMEIS/niftyreg.git /tmp/niftyreg-src \ + && mkdir /tmp/niftyreg-build \ + && cd /tmp/niftyreg-build \ + && cmake -DCMAKE_INSTALL_PREFIX=/opt/niftyreg /tmp/niftyreg-src \ + && make \ + && make install +ENV PATH=/opt/niftyreg/bin:$PATH + + +####################### new: python 3.10 + +RUN wget https://www.python.org/ftp/python/3.10.8/Python-3.10.8.tgz +RUN tar xzf Python-3.10.8.tgz +#RUN cd Python-3.10.8 +#RUN echo $(pwd) +RUN Python-3.10.8/configure --enable-optimizations +#RUN Python-3.10.8/make altinstall +RUN apt-get install zlib1g-dev +RUN make altinstall + +RUN echo $(which python3.10) + +RUN echo $(python3.10 -V ) + +RUN echo $(which pip3.10) +RUN echo $(pip3.10 -V ) + +RUN echo $(which python) && \ + echo $(which python3.10) && \ + ln -s /usr/local/bin/python3.10 /usr/bin/python && \ + ln -s /usr/local/bin/pip3.10 /usr/bin/pip + +RUN echo $(which python) +RUN echo $(which pip) + + ################################################## Install SPM12 as MCR RUN apt-get -y install unzip xorg wget @@ -193,16 +231,6 @@ RUN wget --no-check-certificate --progress=bar:force -P /opt https://www.fil.ion && chmod +x /opt/spm${SPM_VERSION}/spm${SPM_VERSION} ENV SPM_DIR /opt/spm${SPM_VERSION} -######################## NiftiReg -RUN apt-get install --yes --no-install-recommends \ - ca-certificates cmake gcc g++ git make \ - && git clone https://github.com/KCL-BMEIS/niftyreg.git /tmp/niftyreg-src \ - && mkdir /tmp/niftyreg-build \ - && cd /tmp/niftyreg-build \ - && cmake -DCMAKE_INSTALL_PREFIX=/opt/niftyreg /tmp/niftyreg-src \ - && make \ - && make install -ENV PATH=/opt/niftyreg/bin:$PATH ################################################## Finishing RUN apt-get clean \ diff --git a/Dockerfile_macapype_env_nomcr b/Dockerfile_macapype_env_nomcr index a2549ab8..da6a53bd 100644 --- a/Dockerfile_macapype_env_nomcr +++ b/Dockerfile_macapype_env_nomcr @@ -173,6 +173,35 @@ RUN apt-get install --yes --no-install-recommends \ && make install ENV PATH=/opt/niftyreg/bin:$PATH + +####################### new: python 3.10 + +RUN wget https://www.python.org/ftp/python/3.10.8/Python-3.10.8.tgz +RUN tar xzf Python-3.10.8.tgz +#RUN cd Python-3.10.8 +#RUN echo $(pwd) +RUN Python-3.10.8/configure --enable-optimizations +#RUN Python-3.10.8/make altinstall +RUN apt-get install zlib1g-dev +RUN make altinstall + +RUN echo $(which python3.10) + +RUN echo $(python3.10 -V ) + +RUN echo $(which pip3.10) +RUN echo $(pip3.10 -V ) + +RUN echo $(which python) && \ + echo $(which python3.10) && \ + ln -s /usr/local/bin/python3.10 /usr/bin/python && \ + ln -s /usr/local/bin/pip3.10 /usr/bin/pip + +RUN echo $(which python) +RUN echo $(which pip) + + + ################################################## Finishing RUN apt-get clean \ && rm -rf /var/lib/apt/lists/* diff --git a/Dockerfile_nomcr b/Dockerfile_nomcr index 79f2faf5..82864e82 100644 --- a/Dockerfile_nomcr +++ b/Dockerfile_nomcr @@ -9,7 +9,7 @@ # # Timestamp: 2020/12/02 18:33:44 UTC -FROM macatools/macapype_env:v0.1.2 +FROM macatools/macapype_env:v0.2 USER root diff --git a/Dockerfile_testpypi_nomcr b/Dockerfile_testpypi_nomcr index d71e81bc..cc1ef69d 100644 --- a/Dockerfile_testpypi_nomcr +++ b/Dockerfile_testpypi_nomcr @@ -9,7 +9,7 @@ # # Timestamp: 2020/12/02 18:33:44 UTC -FROM macatools/macapype_env:v0.1.2 +FROM macatools/macapype_env:v0.2 USER root From 1c9c26dbd7b50e82dc35dfc5a7a818b467932a09 Mon Sep 17 00:00:00 2001 From: David Meunier Date: Wed, 20 Mar 2024 15:22:48 +0100 Subject: [PATCH 2/2] python and pip are already configured and shortcuted in macapype _env --- Dockerfile | 14 ++++---------- Dockerfile_nomcr | 12 +++--------- Dockerfile_testpypi | 15 ++++----------- Dockerfile_testpypi_nomcr | 13 +++---------- 4 files changed, 14 insertions(+), 40 deletions(-) diff --git a/Dockerfile b/Dockerfile index 99e0bb68..973b8d59 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,7 +9,7 @@ # # Timestamp: 2020/12/02 18:33:44 UTC -FROM macatools/macapype_env:v0.1.2-spm +FROM macatools/macapype_env:v0.2-spm USER root @@ -18,17 +18,16 @@ ARG DEBIAN_FRONTEND="noninteractive" MAINTAINER David Meunier "david.meunier@univ-amu.fr" ######################## Python packages -RUN apt-get update && apt-get install -y git python3-pip libpng-dev libfreetype6-dev libxft-dev libblas-dev liblapack-dev libatlas-base-dev gfortran libxml2-dev libxslt1-dev wget graphviz +RUN apt-get update && apt-get install -y git libpng-dev libfreetype6-dev libxft-dev libblas-dev liblapack-dev libatlas-base-dev gfortran libxml2-dev libxslt1-dev wget graphviz RUN apt-get install -y python3-pil python3-pil.imagetk -RUN python3 -m pip install -U pip -RUN python3 -m pip install -U pillow +RUN python -m pip install -U pillow #RUN pip3 install pillow #RUN apt-get install libx11-6 libxext6 libxt6 # matlab -RUN pip3 install xvfbwrapper \ +RUN pip install xvfbwrapper \ psutil \ numpy \ scipy \ @@ -57,11 +56,6 @@ RUN pip3 install xvfbwrapper \ ############################################# install macapype -RUN echo $(which python) && \ - echo $(which python3) && \ - ln -s /usr/bin/python3 /usr/bin/python && \ - ln -s /usr/bin/pip3 /usr/bin/pip - RUN pip install --pre macapype && python -c "import macapype; print(macapype.__version__)" ################################################## Finishing diff --git a/Dockerfile_nomcr b/Dockerfile_nomcr index 82864e82..62eb4bc6 100644 --- a/Dockerfile_nomcr +++ b/Dockerfile_nomcr @@ -18,17 +18,16 @@ ARG DEBIAN_FRONTEND="noninteractive" MAINTAINER David Meunier "david.meunier@univ-amu.fr" ######################## Python packages -RUN apt-get update && apt-get install -y git python3-pip libpng-dev libfreetype6-dev libxft-dev libblas-dev liblapack-dev libatlas-base-dev gfortran libxml2-dev libxslt1-dev wget graphviz +RUN apt-get update && apt-get install -y git libpng-dev libfreetype6-dev libxft-dev libblas-dev liblapack-dev libatlas-base-dev gfortran libxml2-dev libxslt1-dev wget graphviz RUN apt-get install -y python3-pil python3-pil.imagetk -RUN python3 -m pip install -U pip -RUN python3 -m pip install -U pillow +RUN python -m pip install -U pillow #RUN pip3 install pillow #RUN apt-get install libx11-6 libxext6 libxt6 # matlab -RUN pip3 install xvfbwrapper \ +RUN pip install xvfbwrapper \ psutil \ numpy \ scipy \ @@ -57,11 +56,6 @@ RUN pip3 install xvfbwrapper \ ############################################# install macapype -RUN echo $(which python) && \ - echo $(which python3) && \ - ln -s /usr/bin/python3 /usr/bin/python && \ - ln -s /usr/bin/pip3 /usr/bin/pip - RUN pip install --pre macapype && python -c "import macapype; print(macapype.__version__)" ################################################## Finishing diff --git a/Dockerfile_testpypi b/Dockerfile_testpypi index 43c756ed..5e792ea3 100644 --- a/Dockerfile_testpypi +++ b/Dockerfile_testpypi @@ -17,17 +17,16 @@ ARG DEBIAN_FRONTEND="noninteractive" MAINTAINER David Meunier "david.meunier@univ-amu.fr" ######################## Python packages -RUN apt-get update && apt-get install -y git python3-pip libpng-dev libfreetype6-dev libxft-dev libblas-dev liblapack-dev libatlas-base-dev gfortran libxml2-dev libxslt1-dev wget graphviz +RUN apt-get update && apt-get install -y git libpng-dev libfreetype6-dev libxft-dev libblas-dev liblapack-dev libatlas-base-dev gfortran libxml2-dev libxslt1-dev wget graphviz RUN apt-get install -y python3-pil python3-pil.imagetk -RUN python3 -m pip install -U pip -RUN python3 -m pip install -U pillow -#RUN pip3 install pillow +RUN python -m pip install -U pillow +#RUN pip install pillow #RUN apt-get install libx11-6 libxext6 libxt6 # matlab -RUN pip3 install xvfbwrapper \ +RUN pip install xvfbwrapper \ psutil \ numpy \ scipy \ @@ -55,12 +54,6 @@ RUN pip3 install xvfbwrapper \ brain-slam ############################################# install macapype - -RUN echo $(which python) && \ - echo $(which python3) && \ - ln -s /usr/bin/python3 /usr/bin/python && \ - ln -s /usr/bin/pip3 /usr/bin/pip - RUN pip install --no-deps --index-url https://test.pypi.org/simple/ --pre macapype && python -c "import macapype; print(macapype.__version__)" ################################################## Finishing diff --git a/Dockerfile_testpypi_nomcr b/Dockerfile_testpypi_nomcr index cc1ef69d..6c78fffe 100644 --- a/Dockerfile_testpypi_nomcr +++ b/Dockerfile_testpypi_nomcr @@ -18,17 +18,15 @@ ARG DEBIAN_FRONTEND="noninteractive" MAINTAINER David Meunier "david.meunier@univ-amu.fr" ######################## Python packages -RUN apt-get update && apt-get install -y git python3-pip libpng-dev libfreetype6-dev libxft-dev libblas-dev liblapack-dev libatlas-base-dev gfortran libxml2-dev libxslt1-dev wget graphviz +RUN apt-get update && apt-get install -y git libpng-dev libfreetype6-dev libxft-dev libblas-dev liblapack-dev libatlas-base-dev gfortran libxml2-dev libxslt1-dev wget graphviz RUN apt-get install -y python3-pil python3-pil.imagetk - -RUN python3 -m pip install -U pip -RUN python3 -m pip install -U pillow +RUN python -m pip install -U pillow #RUN pip3 install pillow #RUN apt-get install libx11-6 libxext6 libxt6 # matlab -RUN pip3 install xvfbwrapper \ +RUN pip install xvfbwrapper \ psutil \ numpy \ scipy \ @@ -57,11 +55,6 @@ RUN pip3 install xvfbwrapper \ ############################################# install macapype -RUN echo $(which python) && \ - echo $(which python3) && \ - ln -s /usr/bin/python3 /usr/bin/python && \ - ln -s /usr/bin/pip3 /usr/bin/pip - RUN pip install --no-deps --index-url https://test.pypi.org/simple/ --pre macapype && python -c "import macapype; print(macapype.__version__)" ################################################## Finishing