From 942ab9604663cac52f210fa358a7ad70bb753d98 Mon Sep 17 00:00:00 2001 From: Ayaz Salikhov Date: Thu, 3 Oct 2024 10:51:24 +0100 Subject: [PATCH] Use awk to pin python major.minor version (#2151) --- images/docker-stacks-foundation/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/images/docker-stacks-foundation/Dockerfile b/images/docker-stacks-foundation/Dockerfile index 9c1a344fef..3ed18442f7 100644 --- a/images/docker-stacks-foundation/Dockerfile +++ b/images/docker-stacks-foundation/Dockerfile @@ -131,7 +131,7 @@ RUN set -x && \ rm -rf /tmp/bin/ && \ # Pin major.minor version of python # https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-pkgs.html#preventing-packages-from-updating-pinning - mamba list --full-name 'python' | tail -1 | tr -s ' ' | cut -d ' ' -f 1,2 | sed 's/\.[^.]*$/.*/' >> "${CONDA_DIR}/conda-meta/pinned" && \ + mamba list --full-name 'python' | awk 'END{sub("[^.]*$", "*", $2); print $1 " " $2}' >> "${CONDA_DIR}/conda-meta/pinned" && \ mamba clean --all -f -y && \ fix-permissions "${CONDA_DIR}" && \ fix-permissions "/home/${NB_USER}"