Skip to content

Commit

Permalink
FIX use python 3.9 in Docker
Browse files Browse the repository at this point in the history
  • Loading branch information
mvdoc committed Apr 20, 2024
1 parent 43084a1 commit b6f2034
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
17 changes: 8 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,21 @@ RUN meshlab --version
ENV SKLEARN_NO_OPENMP="1"
COPY [".", \
"/headcase-pipeline"]
ENV CONDA_DIR="/opt/miniconda-latest" \
PATH="/opt/miniconda-latest/bin:$PATH"
ENV CONDA_DIR="/opt/miniconda-py39_24.1.2-0" \
PATH="/opt/miniconda-py39_24.1.2-0/bin:$PATH"
RUN apt-get update -qq \
&& apt-get install -y -q --no-install-recommends \
bzip2 \
ca-certificates \
curl \
&& rm -rf /var/lib/apt/lists/* \
# Install dependencies.
&& export PATH="/opt/miniconda-latest/bin:$PATH" \
&& export PATH="/opt/miniconda-py39_24.1.2-0/bin:$PATH" \
&& echo "Downloading Miniconda installer ..." \
&& conda_installer="/tmp/miniconda.sh" \
&& curl -fsSL -o "$conda_installer" https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh \
&& bash "$conda_installer" -b -p /opt/miniconda-latest \
&& curl -fsSL -o "$conda_installer" https://repo.continuum.io/miniconda/Miniconda3-py39_24.1.2-0-Linux-x86_64.sh \
&& bash "$conda_installer" -b -p /opt/miniconda-py39_24.1.2-0 \
&& rm -f "$conda_installer" \
&& conda update -yq -nbase conda \
# Prefer packages in conda-forge
&& conda config --system --prepend channels conda-forge \
# Packages in lower-priority channels not considered if a package with the same
Expand Down Expand Up @@ -174,14 +173,14 @@ RUN printf '{ \
{ \
"name": "env", \
"kwds": { \
"CONDA_DIR": "/opt/miniconda-latest", \
"PATH": "/opt/miniconda-latest/bin:$PATH" \
"CONDA_DIR": "/opt/miniconda-py39_24.1.2-0", \
"PATH": "/opt/miniconda-py39_24.1.2-0/bin:$PATH" \
} \
}, \
{ \
"name": "run", \
"kwds": { \
"command": "apt-get update -qq\\napt-get install -y -q --no-install-recommends \\\\\\n bzip2 \\\\\\n ca-certificates \\\\\\n curl\\nrm -rf /var/lib/apt/lists/*\\n# Install dependencies.\\nexport PATH=\\"/opt/miniconda-latest/bin:$PATH\\"\\necho \\"Downloading Miniconda installer ...\\"\\nconda_installer=\\"/tmp/miniconda.sh\\"\\ncurl -fsSL -o \\"$conda_installer\\" https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh\\nbash \\"$conda_installer\\" -b -p /opt/miniconda-latest\\nrm -f \\"$conda_installer\\"\\nconda update -yq -nbase conda\\n# Prefer packages in conda-forge\\nconda config --system --prepend channels conda-forge\\n# Packages in lower-priority channels not considered if a package with the same\\n# name exists in a higher priority channel. Can dramatically speed up installations.\\n# Conda recommends this as a default\\n# https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-channels.html\\nconda config --set channel_priority strict\\nconda config --system --set auto_update_conda false\\nconda config --system --set show_channel_urls true\\n# Enable `conda activate`\\nconda init bash\\nconda install -y --name base \\\\\\n \\"python=3.9\\" \\\\\\n \\"gxx_linux-64\\"\\nbash -c \\"source activate base\\n python -m pip install --no-cache-dir \\\\\\n \\"-r\\" \\\\\\n \\"/headcase-pipeline/requirements.txt\\"\\"\\n# Clean up\\nsync && conda clean --all --yes && sync\\nrm -rf ~/.cache/pip/*" \
"command": "apt-get update -qq\\napt-get install -y -q --no-install-recommends \\\\\\n bzip2 \\\\\\n ca-certificates \\\\\\n curl\\nrm -rf /var/lib/apt/lists/*\\n# Install dependencies.\\nexport PATH=\\"/opt/miniconda-py39_24.1.2-0/bin:$PATH\\"\\necho \\"Downloading Miniconda installer ...\\"\\nconda_installer=\\"/tmp/miniconda.sh\\"\\ncurl -fsSL -o \\"$conda_installer\\" https://repo.continuum.io/miniconda/Miniconda3-py39_24.1.2-0-Linux-x86_64.sh\\nbash \\"$conda_installer\\" -b -p /opt/miniconda-py39_24.1.2-0\\nrm -f \\"$conda_installer\\"\\n# Prefer packages in conda-forge\\nconda config --system --prepend channels conda-forge\\n# Packages in lower-priority channels not considered if a package with the same\\n# name exists in a higher priority channel. Can dramatically speed up installations.\\n# Conda recommends this as a default\\n# https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-channels.html\\nconda config --set channel_priority strict\\nconda config --system --set auto_update_conda false\\nconda config --system --set show_channel_urls true\\n# Enable `conda activate`\\nconda init bash\\nconda install -y --name base \\\\\\n \\"python=3.9\\" \\\\\\n \\"gxx_linux-64\\"\\nbash -c \\"source activate base\\n python -m pip install --no-cache-dir \\\\\\n \\"-r\\" \\\\\\n \\"/headcase-pipeline/requirements.txt\\"\\"\\n# Clean up\\nsync && conda clean --all --yes && sync\\nrm -rf ~/.cache/pip/*" \
} \
}, \
{ \
Expand Down
2 changes: 1 addition & 1 deletion generate_dockerfile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ docker run --rm repronim/neurodocker:latest generate docker \
--env SKLEARN_NO_OPENMP=1 \
--copy . "/headcase-pipeline" \
--miniconda \
version=latest \
version="py39_24.1.2-0" \
conda_install="python=3.9 gxx_linux-64" \
pip_install="-r /headcase-pipeline/requirements.txt" \
--run "useradd -m -s /bin/bash -G users headcase" \
Expand Down

0 comments on commit b6f2034

Please sign in to comment.