Skip to content

Commit 332a4a9

Browse files
authored
Fix failed docker CI using more reasoning grep regex to parse python version (aiidateam#6581)
The grep command failed that extracts the python version from mamba list failed because an indentation was added. See the python string in the output of `mamba list`: ``` List of packages in environment: "/opt/conda" Name Version Build Channel ──────────────────────────────────────────────────── python 3.10.13 hd12c33a_1_cpython conda-forge ```
1 parent 98ffc33 commit 332a4a9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

.docker/aiida-core-base/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ RUN set -x && \
137137
mamba && \
138138
rm micromamba && \
139139
# Pin major.minor version of python
140-
mamba list python | grep '^python ' | tr -s ' ' | cut -d ' ' -f 1,2 >> "${CONDA_DIR}/conda-meta/pinned" && \
140+
mamba list python | grep -oP 'python\s+\K[\d.]+' | tr -s ' ' | cut -d ' ' -f 1,2 >> "${CONDA_DIR}/conda-meta/pinned" && \
141141
mamba clean --all -f -y && \
142142
fix-permissions "${CONDA_DIR}" && \
143143
fix-permissions "/home/${SYSTEM_USER}"

0 commit comments

Comments
 (0)