From 8e5ff23e1b24dcaf1b8825fc963abc4d3746be4b Mon Sep 17 00:00:00 2001 From: Pepijn Noltes Date: Sun, 16 Jun 2024 14:22:24 +0200 Subject: [PATCH] Move celixdev user to dev images --- .devcontainer/Containerfile | 23 +++++++++++++++-------- .github/workflows/containers.yml | 4 ++-- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/.devcontainer/Containerfile b/.devcontainer/Containerfile index ec060ef9f..28cba1711 100644 --- a/.devcontainer/Containerfile +++ b/.devcontainer/Containerfile @@ -37,18 +37,11 @@ RUN DEBIAN_FRONTEND="noninteractive" apt-get update && \ python3-pip && \ apt-get clean -# Add user celixdev with sudo rights and a "celixdev" password -RUN useradd -m -s /bin/bash -G sudo celixdev && \ - echo "%sudo ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers && \ - echo "celixdev:celixdev" | chpasswd -USER celixdev -WORKDIR /home/celixdev - # Build image using conan & cmake FROM build as conan-build # Install conan -RUN sudo pip3 install conan && pip3 cache purge +RUN pip3 install conan && pip3 cache purge # Setup conan profile RUN conan profile detect @@ -76,6 +69,13 @@ RUN DEBIAN_FRONTEND="noninteractive" sudo apt-get update && \ FROM conan-build as conan-dev +# Add user celixdev with sudo rights and a "celixdev" password +RUN useradd -m -s /bin/bash -G sudo celixdev && \ + echo "%sudo ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers && \ + echo "celixdev:celixdev" | chpasswd +USER celixdev +WORKDIR /home/celixdev + #Install development dependencies RUN sudo DEBIAN_FRONTEND="noninteractive" apt-get update && \ sudo DEBIAN_FRONTEND="noninteractive" apt-get install -y --no-install-recommends \ @@ -86,6 +86,13 @@ RUN sudo mkdir /run/sshd FROM apt-build as apt-dev +# Add user celixdev with sudo rights and a "celixdev" password +RUN useradd -m -s /bin/bash -G sudo celixdev && \ + echo "%sudo ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers && \ + echo "celixdev:celixdev" | chpasswd +USER celixdev +WORKDIR /home/celixdev + #Install development dependencies RUN sudo DEBIAN_FRONTEND="noninteractive" apt-get update && \ sudo DEBIAN_FRONTEND="noninteractive" apt-get install -y --no-install-recommends \ diff --git a/.github/workflows/containers.yml b/.github/workflows/containers.yml index 3128eefc5..281500bad 100644 --- a/.github/workflows/containers.yml +++ b/.github/workflows/containers.yml @@ -18,7 +18,7 @@ jobs: docker build --tag apache/celix-conan-build:latest --target conan-build --file .devcontainer/Containerfile . - name: Build and test Celix the conan container image run: | - docker run --rm -v $(pwd):/workspace --userns=keep-id apache/celix-conan-build:latest /bin/bash -c \ + docker run --rm -v $(pwd):/workspace apache/celix-conan-build:latest /bin/bash -c \ "cd /workspace && \ conan build . --build missing --options build_all=True --options enable_address_sanitizer=True \ --options enable_testing=True --options enable_ccache=True --output-folder build \ @@ -38,7 +38,7 @@ jobs: docker build --tag apache/celix-apt-build:latest --target apt-build --file .devcontainer/Containerfile . - name: Build and test Celix the conan container image run: | - docker run --rm -v $(pwd):/workspace --userns=keep-id apache/celix-apt-build:latest /bin/bash -c \ + docker run --rm -v $(pwd):/workspace apache/celix-apt-build:latest /bin/bash -c \ "mkdir /workspace/build && cd /workspace/build && \ cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_EXPERIMENTAL=ON -DENABLE_TESTING=ON -DRSA_JSON_RPC=ON \ -DRSA_REMOTE_SERVICE_ADMIN_SHM_V2=ON -DENABLE_CCACHE=ON .. && \