From 282023731f558f4cb4b618399c96ddd1df3fd6b1 Mon Sep 17 00:00:00 2001 From: Alexander Taepper Date: Mon, 6 Jan 2025 13:56:29 +0100 Subject: [PATCH] fix: install conan with pipx instead of pip --- Dockerfile_dependencies | 11 +++++++++-- Dockerfile_linter_dependencies | 15 ++++++++++----- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/Dockerfile_dependencies b/Dockerfile_dependencies index 33a6b4338..a4af3420f 100644 --- a/Dockerfile_dependencies +++ b/Dockerfile_dependencies @@ -4,9 +4,16 @@ ARG TARGETPLATFORM RUN apt update && apt dist-upgrade -y \ && apt install -y \ - cmake python3-pip + build-essential cmake python3 pipx -RUN pip install conan==2.8.1 +# ensurepath adds a line to .profile +# which puts the pipx install directory ~/.local/bin into the PATH variable +RUN python3 -m pipx ensurepath +# .profile is only sourced on relogin. Dockerfile shells do not login by default. +# This line tells it to execute all subsequent commands with a prior login +SHELL ["/bin/bash", "-login", "-c"] + +RUN python3 -m pipx install conan==2.8.1 WORKDIR /src COPY conanfile.py conanprofile.docker conanprofile.docker_arm ./ diff --git a/Dockerfile_linter_dependencies b/Dockerfile_linter_dependencies index 794eef4d9..ba0df5559 100644 --- a/Dockerfile_linter_dependencies +++ b/Dockerfile_linter_dependencies @@ -6,14 +6,19 @@ WORKDIR /src RUN apt update \ && apt install -y \ - cmake python3-pip software-properties-common wget gnupg lsb-release \ + build-essential cmake python3 pipx software-properties-common wget gnupg lsb-release \ && wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc \ && add-apt-repository 'deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy main' \ - && apt install -y clang-tidy-15 \ - && apt install -y jq \ - && apt install -y curl + && apt install -y clang-tidy-15 jq curl -RUN pip install conan==2.8.1 +# ensurepath adds a line to .profile +# which puts the pipx install directory ~/.local/bin into the PATH variable +RUN python3 -m pipx ensurepath +# .profile is only sourced on relogin. Dockerfile shells do not login by default. +# This line tells it to execute all subsequent commands with a prior login +SHELL ["/bin/bash", "-login", "-c"] + +RUN python3 -m pipx install conan==2.8.1 COPY conanfile.py conanprofile.docker conanprofile.docker_arm ./ RUN if [ "$TARGETPLATFORM" = "linux/arm64" ]; then \