Skip to content

Commit

Permalink
Move celixdev user to dev images
Browse files Browse the repository at this point in the history
  • Loading branch information
pnoltes committed Jun 16, 2024
1 parent 8bc3f59 commit 8e5ff23
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
23 changes: 15 additions & 8 deletions .devcontainer/Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 \
Expand All @@ -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 \
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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 .. && \
Expand Down

0 comments on commit 8e5ff23

Please sign in to comment.