From d36ee8ad3f73949cbc2afb6c03f5e563e16f4df1 Mon Sep 17 00:00:00 2001 From: John Lees Date: Mon, 5 Jan 2026 11:20:37 +0000 Subject: [PATCH 01/11] Attempt to update docker conda to miniforge --- docker/Dockerfile | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 460c07f..b436593 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -35,19 +35,20 @@ RUN chown $UID:$GID /usr/local/bin/entrypoint.sh && \ USER $USER -# install miniconda -ENV MINICONDA_VERSION latest -ENV CONDA_DIR $HOME/miniconda3 -RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-$MINICONDA_VERSION-Linux-x86_64.sh -O ~/miniconda.sh && \ - chmod +x ~/miniconda.sh && \ - ~/miniconda.sh -b -p $CONDA_DIR && \ - rm ~/miniconda.sh +# install miniforge +ENV CONDA_DIR $HOME/miniforge3 +RUN wget -O Miniforge3.sh "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-$(uname)-$(uname -m).sh" && \ + chmod +x ~/Miniforge3.sh && \ + bash ~/Miniforge3.sh -b -p $CONDA_DIR \ + ~/Miniforge3.sh -b -p $CONDA_DIR && \ + rm ~/Miniforge3.sh # make non-activate conda commands available ENV PATH=$CONDA_DIR/bin:$PATH # make conda activate command available from /bin/bash --login shells RUN echo ". $CONDA_DIR/etc/profile.d/conda.sh" >> ~/.profile +RUN echo ". $CONDA_DIR/etc/profile.d/mamba.sh" >> ~/.profile # make conda activate command available from /bin/bash --interative shells RUN conda init bash @@ -62,8 +63,7 @@ WORKDIR $PROJECT_DIR # build the conda environment ENV ENV_PREFIX $PROJECT_DIR/env -RUN conda update --name base --channel defaults conda && \ - conda env create --prefix $ENV_PREFIX --file /tmp/environment.yml && \ +RUN conda env create --prefix $ENV_PREFIX --file /tmp/environment.yml && \ conda clean --all --yes # use an entrypoint script to insure conda environment is properly activated at runtime From 44bbedb0634c77ff4651716f3718c0c3d48d4f66 Mon Sep 17 00:00:00 2001 From: John Lees Date: Mon, 5 Jan 2026 11:23:29 +0000 Subject: [PATCH 02/11] Fix error in miniforge cmd --- docker/Dockerfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index b436593..4215432 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -39,8 +39,7 @@ USER $USER ENV CONDA_DIR $HOME/miniforge3 RUN wget -O Miniforge3.sh "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-$(uname)-$(uname -m).sh" && \ chmod +x ~/Miniforge3.sh && \ - bash ~/Miniforge3.sh -b -p $CONDA_DIR \ - ~/Miniforge3.sh -b -p $CONDA_DIR && \ + bash ~/Miniforge3.sh -b -p $CONDA_DIR && \ rm ~/Miniforge3.sh # make non-activate conda commands available From b56a4649b085e0d8140f8750b53e8f2338a4fde6 Mon Sep 17 00:00:00 2001 From: John Lees Date: Mon, 5 Jan 2026 11:36:34 +0000 Subject: [PATCH 03/11] Add prefix correctly --- docker/Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 4215432..2751a54 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -36,8 +36,9 @@ RUN chown $UID:$GID /usr/local/bin/entrypoint.sh && \ USER $USER # install miniforge +# NB need to set homedir explicitly, or use `WORKDIR $HOME` ENV CONDA_DIR $HOME/miniforge3 -RUN wget -O Miniforge3.sh "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-$(uname)-$(uname -m).sh" && \ +RUN wget -O ~/Miniforge3.sh "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-$(uname)-$(uname -m).sh" && \ chmod +x ~/Miniforge3.sh && \ bash ~/Miniforge3.sh -b -p $CONDA_DIR && \ rm ~/Miniforge3.sh From ec0e16fd70cda7dcc33dfd8924e0e8d31e401e34 Mon Sep 17 00:00:00 2001 From: John Lees Date: Mon, 5 Jan 2026 13:27:06 +0000 Subject: [PATCH 04/11] Add mamba init --- docker/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/docker/Dockerfile b/docker/Dockerfile index 2751a54..fb5c3a1 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -52,6 +52,7 @@ RUN echo ". $CONDA_DIR/etc/profile.d/mamba.sh" >> ~/.profile # make conda activate command available from /bin/bash --interative shells RUN conda init bash +RUN mamba shell init # create a project directory inside user home # (this isn't used with a clone running snakemake) From 0db0945f9d1424e31aa77d1aa317cd72842743b8 Mon Sep 17 00:00:00 2001 From: John Lees Date: Mon, 5 Jan 2026 13:44:13 +0000 Subject: [PATCH 05/11] Change mamba prefix --- docker/Dockerfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index fb5c3a1..8c04acf 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -50,9 +50,9 @@ ENV PATH=$CONDA_DIR/bin:$PATH RUN echo ". $CONDA_DIR/etc/profile.d/conda.sh" >> ~/.profile RUN echo ". $CONDA_DIR/etc/profile.d/mamba.sh" >> ~/.profile -# make conda activate command available from /bin/bash --interative shells -RUN conda init bash +# make conda activate command available from /bin/bash --interactive shells RUN mamba shell init +RUN conda shell init # create a project directory inside user home # (this isn't used with a clone running snakemake) @@ -64,8 +64,8 @@ WORKDIR $PROJECT_DIR # build the conda environment ENV ENV_PREFIX $PROJECT_DIR/env -RUN conda env create --prefix $ENV_PREFIX --file /tmp/environment.yml && \ - conda clean --all --yes +RUN mamba env create -r $ENV_PREFIX --prefix $ENV_PREFIX --file /tmp/environment.yml && \ + mamba clean --all --yes # use an entrypoint script to insure conda environment is properly activated at runtime USER root From c2cd390b12d11a5ad262b05432c562aeef3a2d13 Mon Sep 17 00:00:00 2001 From: John Lees Date: Mon, 5 Jan 2026 13:48:11 +0000 Subject: [PATCH 06/11] Remove conda commands --- docker/Dockerfile | 2 -- 1 file changed, 2 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 8c04acf..0226756 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -47,12 +47,10 @@ RUN wget -O ~/Miniforge3.sh "https://github.com/conda-forge/miniforge/releases/l ENV PATH=$CONDA_DIR/bin:$PATH # make conda activate command available from /bin/bash --login shells -RUN echo ". $CONDA_DIR/etc/profile.d/conda.sh" >> ~/.profile RUN echo ". $CONDA_DIR/etc/profile.d/mamba.sh" >> ~/.profile # make conda activate command available from /bin/bash --interactive shells RUN mamba shell init -RUN conda shell init # create a project directory inside user home # (this isn't used with a clone running snakemake) From ea4f6197a369d989ccddafdc2dc3f9c5f7652a34 Mon Sep 17 00:00:00 2001 From: John Lees Date: Mon, 5 Jan 2026 13:57:51 +0000 Subject: [PATCH 07/11] set mamba_exe --- docker/Dockerfile | 1 + docker/entrypoint.sh | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 0226756..0c2785f 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -64,6 +64,7 @@ WORKDIR $PROJECT_DIR ENV ENV_PREFIX $PROJECT_DIR/env RUN mamba env create -r $ENV_PREFIX --prefix $ENV_PREFIX --file /tmp/environment.yml && \ mamba clean --all --yes +ENV MAMBA_EXE /home/poppipe-usr/miniforge3/bin/mamba # use an entrypoint script to insure conda environment is properly activated at runtime USER root diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index b026041..43e1abb 100644 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -1,5 +1,5 @@ #!/bin/bash --login set -e -conda activate $HOME/app/env +mamba activate $HOME/app/env exec "$@" \ No newline at end of file From b2e0a9aa503f6ec0b19176bcad9e912e92404e68 Mon Sep 17 00:00:00 2001 From: John Lees Date: Mon, 5 Jan 2026 14:04:32 +0000 Subject: [PATCH 08/11] Remove mamba.sh --- docker/Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 0c2785f..aa59a42 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -47,7 +47,8 @@ RUN wget -O ~/Miniforge3.sh "https://github.com/conda-forge/miniforge/releases/l ENV PATH=$CONDA_DIR/bin:$PATH # make conda activate command available from /bin/bash --login shells -RUN echo ". $CONDA_DIR/etc/profile.d/mamba.sh" >> ~/.profile +# DEPRECATED -- should be done by init below +# RUN echo ". $CONDA_DIR/etc/profile.d/mamba.sh" >> ~/.profile # make conda activate command available from /bin/bash --interactive shells RUN mamba shell init From 8a90b0a956cb2ba02fec773dfafc63e30626ab64 Mon Sep 17 00:00:00 2001 From: John Lees Date: Mon, 5 Jan 2026 14:17:26 +0000 Subject: [PATCH 09/11] Correct init command --- docker/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index aa59a42..a64de9a 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -50,8 +50,8 @@ ENV PATH=$CONDA_DIR/bin:$PATH # DEPRECATED -- should be done by init below # RUN echo ". $CONDA_DIR/etc/profile.d/mamba.sh" >> ~/.profile -# make conda activate command available from /bin/bash --interactive shells -RUN mamba shell init +# make mamba activate command available from /bin/bash --interactive shells +RUN mamba init bash # create a project directory inside user home # (this isn't used with a clone running snakemake) From 726a11f118b79f81c9c4f937b87f4b107a3d0cb0 Mon Sep 17 00:00:00 2001 From: John Lees Date: Mon, 5 Jan 2026 14:28:59 +0000 Subject: [PATCH 10/11] Try another init command --- docker/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index a64de9a..531e68d 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -51,7 +51,7 @@ ENV PATH=$CONDA_DIR/bin:$PATH # RUN echo ". $CONDA_DIR/etc/profile.d/mamba.sh" >> ~/.profile # make mamba activate command available from /bin/bash --interactive shells -RUN mamba init bash +RUN mamba shell init -s bash -r $CONDA_DIR # create a project directory inside user home # (this isn't used with a clone running snakemake) From 8ba4c7ddf9f3973bb447eea9462654c92d783d41 Mon Sep 17 00:00:00 2001 From: John Lees Date: Mon, 5 Jan 2026 14:43:40 +0000 Subject: [PATCH 11/11] Fix ENV statements --- docker/Dockerfile | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 531e68d..6de89ce 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -14,10 +14,10 @@ RUN apt-get update --fix-missing && \ ARG username=poppipe-usr ARG uid=1000 ARG gid=100 -ENV USER $username -ENV UID $uid -ENV GID $gid -ENV HOME /home/$USER +ENV USER=$username +ENV UID=$uid +ENV GID=$gid +ENV HOME=/home/$USER RUN adduser --disabled-password \ --gecos "Non-root user" \ @@ -37,7 +37,7 @@ USER $USER # install miniforge # NB need to set homedir explicitly, or use `WORKDIR $HOME` -ENV CONDA_DIR $HOME/miniforge3 +ENV CONDA_DIR=$HOME/miniforge3 RUN wget -O ~/Miniforge3.sh "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-$(uname)-$(uname -m).sh" && \ chmod +x ~/Miniforge3.sh && \ bash ~/Miniforge3.sh -b -p $CONDA_DIR && \ @@ -55,17 +55,17 @@ RUN mamba shell init -s bash -r $CONDA_DIR # create a project directory inside user home # (this isn't used with a clone running snakemake) -ENV PROJECT_DIR $HOME/app +ENV PROJECT_DIR=$HOME/app RUN mkdir $PROJECT_DIR # copy the code in COPY . $PROJECT_DIR WORKDIR $PROJECT_DIR # build the conda environment -ENV ENV_PREFIX $PROJECT_DIR/env +ENV ENV_PREFIX=$PROJECT_DIR/env RUN mamba env create -r $ENV_PREFIX --prefix $ENV_PREFIX --file /tmp/environment.yml && \ mamba clean --all --yes -ENV MAMBA_EXE /home/poppipe-usr/miniforge3/bin/mamba +ENV MAMBA_EXE=/home/poppipe-usr/miniforge3/bin/mamba # use an entrypoint script to insure conda environment is properly activated at runtime USER root