From a3a75ea26127e4415d1a6a98ad3e33fdfa5d1931 Mon Sep 17 00:00:00 2001 From: Dr Marco Claudio De La Pierre Date: Wed, 16 Aug 2023 00:02:15 +0800 Subject: [PATCH] Use root user in Wave container based on micromamba (#4038) [ci fast] Signed-off-by: Marco De La Pierre --- .../resources/templates/conda/dockerfile-conda-file.txt | 1 + .../templates/conda/dockerfile-conda-packages.txt | 1 + .../src/test/io/seqera/wave/plugin/WaveClientTest.groovy | 2 ++ .../src/test/io/seqera/wave/util/DockerHelperTest.groovy | 7 +++++++ 4 files changed, 11 insertions(+) diff --git a/plugins/nf-wave/src/resources/templates/conda/dockerfile-conda-file.txt b/plugins/nf-wave/src/resources/templates/conda/dockerfile-conda-file.txt index a7cc7806e8..d9be54e326 100644 --- a/plugins/nf-wave/src/resources/templates/conda/dockerfile-conda-file.txt +++ b/plugins/nf-wave/src/resources/templates/conda/dockerfile-conda-file.txt @@ -3,3 +3,4 @@ COPY --chown=$MAMBA_USER:$MAMBA_USER conda.yml /tmp/conda.yml RUN micromamba install -y -n base -f /tmp/conda.yml \ {{base_packages}} && micromamba clean -a -y +USER root diff --git a/plugins/nf-wave/src/resources/templates/conda/dockerfile-conda-packages.txt b/plugins/nf-wave/src/resources/templates/conda/dockerfile-conda-packages.txt index 6885c84ea0..67e01b4378 100644 --- a/plugins/nf-wave/src/resources/templates/conda/dockerfile-conda-packages.txt +++ b/plugins/nf-wave/src/resources/templates/conda/dockerfile-conda-packages.txt @@ -4,3 +4,4 @@ RUN \ {{target}} \ {{base_packages}} && micromamba clean -a -y +USER root diff --git a/plugins/nf-wave/src/test/io/seqera/wave/plugin/WaveClientTest.groovy b/plugins/nf-wave/src/test/io/seqera/wave/plugin/WaveClientTest.groovy index 4005b1c0b8..8e5bcb31df 100644 --- a/plugins/nf-wave/src/test/io/seqera/wave/plugin/WaveClientTest.groovy +++ b/plugins/nf-wave/src/test/io/seqera/wave/plugin/WaveClientTest.groovy @@ -476,6 +476,7 @@ class WaveClientTest extends Specification { micromamba install -y -n base -c conda-forge -c defaults \\ salmon=1.2.3 \\ && micromamba clean -a -y + USER root '''.stripIndent() and: !assets.moduleResources @@ -544,6 +545,7 @@ class WaveClientTest extends Specification { COPY --chown=$MAMBA_USER:$MAMBA_USER conda.yml /tmp/conda.yml RUN micromamba install -y -n base -f /tmp/conda.yml \\ && micromamba clean -a -y + USER root '''.stripIndent() and: assets.condaFile == condaFile diff --git a/plugins/nf-wave/src/test/io/seqera/wave/util/DockerHelperTest.groovy b/plugins/nf-wave/src/test/io/seqera/wave/util/DockerHelperTest.groovy index 566838978a..4112c96900 100644 --- a/plugins/nf-wave/src/test/io/seqera/wave/util/DockerHelperTest.groovy +++ b/plugins/nf-wave/src/test/io/seqera/wave/util/DockerHelperTest.groovy @@ -41,6 +41,7 @@ class DockerHelperTest extends Specification { RUN micromamba install -y -n base -f /tmp/conda.yml \\ && micromamba install -y -n base conda-forge::procps-ng \\ && micromamba clean -a -y + USER root '''.stripIndent() } @@ -52,6 +53,7 @@ class DockerHelperTest extends Specification { COPY --chown=$MAMBA_USER:$MAMBA_USER conda.yml /tmp/conda.yml RUN micromamba install -y -n base -f /tmp/conda.yml \\ && micromamba clean -a -y + USER root '''.stripIndent() } @@ -67,6 +69,7 @@ class DockerHelperTest extends Specification { micromamba install -y -n base -c conda-forge -c defaults \\ bwa=0.7.15 salmon=1.1.1 \\ && micromamba clean -a -y + USER root '''.stripIndent() } @@ -84,6 +87,7 @@ class DockerHelperTest extends Specification { bwa=0.7.15 salmon=1.1.1 \\ && micromamba install -y -n base foo::one bar::two \\ && micromamba clean -a -y + USER root '''.stripIndent() } @@ -99,6 +103,7 @@ class DockerHelperTest extends Specification { micromamba install -y -n base -c foo -c bar \\ bwa=0.7.15 salmon=1.1.1 \\ && micromamba clean -a -y + USER root '''.stripIndent() } @@ -115,6 +120,7 @@ class DockerHelperTest extends Specification { micromamba install -y -n base -c conda-forge -c defaults \\ bwa=0.7.15 salmon=1.1.1 \\ && micromamba clean -a -y + USER root USER my-user RUN apt-get update -y && apt-get install -y nano '''.stripIndent() @@ -134,6 +140,7 @@ class DockerHelperTest extends Specification { micromamba install -y -n base -c conda-forge -c defaults \\ -f https://foo.com/some/conda-lock.yml \\ && micromamba clean -a -y + USER root USER my-user RUN apt-get update -y && apt-get install -y procps '''.stripIndent()