Skip to content

Commit

Permalink
Fix failed docker CI using more reasoning grep regex to parse python …
Browse files Browse the repository at this point in the history
…version (#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
```
  • Loading branch information
unkcpz authored Oct 17, 2024
1 parent 98ffc33 commit 332a4a9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion .docker/aiida-core-base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ RUN set -x && \
mamba && \
rm micromamba && \
# Pin major.minor version of python
mamba list python | grep '^python ' | tr -s ' ' | cut -d ' ' -f 1,2 >> "${CONDA_DIR}/conda-meta/pinned" && \
mamba list python | grep -oP 'python\s+\K[\d.]+' | tr -s ' ' | cut -d ' ' -f 1,2 >> "${CONDA_DIR}/conda-meta/pinned" && \
mamba clean --all -f -y && \
fix-permissions "${CONDA_DIR}" && \
fix-permissions "/home/${SYSTEM_USER}"
Expand Down

0 comments on commit 332a4a9

Please sign in to comment.