Skip to content

Commit bab7986

Browse files
Fedrclaude
andauthored
Add aws-user and github-user to CI docker images, drop --user root (#6356)
* add aws-user and github-user to docker images, drop --user root from workflows Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * drop container-options matrix plumbing entirely Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
1 parent 3bbe1ed commit bab7986

14 files changed

Lines changed: 26 additions & 44 deletions

.github/workflows/build-test-linux-vcpkg.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ jobs:
4141
runs-on: ${{ matrix.os }}
4242
container:
4343
image: meshlib/meshlib-rockylinux8-vcpkg-${{ matrix.arch }}:${{ inputs.docker_image_tag }}
44-
options: --user root
4544
strategy:
4645
fail-fast: false
4746
matrix:

.github/workflows/build-test-ubuntu-arm64.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ jobs:
3737
runs-on: ubuntu-24.04-arm
3838
container:
3939
image: meshlib/meshlib-${{matrix.os}}-arm64:${{inputs.docker_image_tag}}
40-
options: --user root
4140
strategy:
4241
fail-fast: false
4342
matrix:

.github/workflows/build-test-ubuntu-x64.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ jobs:
4040
runs-on: [ubuntu-latest]
4141
container:
4242
image: meshlib/meshlib-${{matrix.os}}:${{inputs.docker_image_tag}}
43-
options: --user root
4443
strategy:
4544
fail-fast: false
4645
matrix: ${{ fromJSON( inputs.config_matrix ) }}

.github/workflows/generate-c-bindings.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ jobs:
1919
contents: read # This is required for actions/checkout
2020
container:
2121
image: meshlib/meshlib-emscripten-generate-c-bindings-arm64:${{inputs.docker_image_tag}}
22-
options: --user root
2322

2423
steps:
2524
- name: Checkout

.github/workflows/pip-build.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,11 @@ jobs:
7777
- extend:
7878
- platform: x86_64
7979
os: rockylinux8-vcpkg-x64
80-
container-options: "--user root"
8180
runner: ubuntu-latest
8281
compiler: /usr/bin/clang++
8382
container-prefix: ""
8483
- platform: aarch64
8584
os: rockylinux8-vcpkg-arm64
86-
container-options: " "
8785
runner: ubuntu-24.04-arm
8886
compiler: /usr/bin/clang++
8987
container-prefix: arm64v8/
@@ -112,12 +110,10 @@ jobs:
112110
rules: |
113111
- extend:
114112
- platform: x86_64
115-
container-options: "--user root"
116113
runner: ubuntu-latest
117114
compiler: /usr/bin/clang++
118115
container-prefix: ""
119116
- platform: aarch64
120-
container-options: " "
121117
runner: ubuntu-24.04-arm
122118
compiler: /usr/bin/clang++
123119
container-prefix: arm64v8/
@@ -159,7 +155,6 @@ jobs:
159155
runs-on: ${{ matrix.runner }}
160156
container:
161157
image: meshlib/meshlib-${{ matrix.os }}:${{ inputs.vcpkg_docker_image_tag || 'latest' }}
162-
options: ${{ matrix.container-options }}
163158
strategy:
164159
fail-fast: false
165160
# `include` enumerates the per-platform combos, surviving platforms
@@ -584,7 +579,6 @@ jobs:
584579
runs-on: ${{ matrix.runner }}
585580
container:
586581
image: ${{ matrix.container-prefix }}${{ matrix.os }}
587-
options: ${{ matrix.container-options }}
588582
strategy:
589583
fail-fast: false
590584
# `include` is the cartesian product (surviving platforms x

.github/workflows/release-tests.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ jobs:
2323
runs-on: ${{ matrix.runner }}
2424
container:
2525
image: ${{matrix.container-prefix}}${{matrix.os}}
26-
options: ${{ matrix.container-options }}
2726
strategy:
2827
fail-fast: false
2928
matrix:
@@ -32,11 +31,9 @@ jobs:
3231
include:
3332
- platform: "x86_64"
3433
runner: ubuntu-latest
35-
container-options: "--user root"
3634
container-prefix: ""
3735
- platform: "aarch64"
3836
runner: ubuntu-24.04-arm
39-
container-options: " " # empty
4037
container-prefix: "arm64v8/"
4138
- os: "ubuntu:20.04"
4239
py-version: "3.8"

.github/workflows/update-docs-manual.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ jobs:
1515
runs-on: ubuntu-24.04-arm
1616
container:
1717
image: meshlib/meshlib-ubuntu22-arm64:latest
18-
options: --user root
1918
strategy:
2019
fail-fast: false
2120
env:

docker/emscripten-build-c-bindingsDockerfile

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,8 @@ FROM base
5959
COPY --from=builder /opt/meshlib-thirdparty/emscripten /usr/local/lib/emscripten
6060
COPY --from=builder /opt/meshlib-thirdparty/emscripten-single /usr/local/lib/emscripten-single
6161

62-
# Setup non-root user (use 1001 to play nicely with actions/checkout@v4)
63-
# https://github.com/actions/checkout/issues/1014
64-
RUN <<EOF
65-
set -e
66-
groupadd -g 1001 user
67-
useradd -m -u 1001 -g user -s /bin/bash user
68-
chmod -R 777 /emsdk/upstream/emscripten/
69-
EOF
62+
RUN chmod -R 777 /emsdk/upstream/emscripten/
7063

71-
# Change to non-root privilege
72-
USER user
64+
RUN useradd -u 8877 -m aws-user
65+
RUN useradd -u 1001 -m github-user
66+
USER github-user

docker/emscripten-generate-c-bindingsDockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,7 @@ RUN <<EOF
2121
apt-get clean
2222
rm -rf /var/lib/apt/lists/*
2323
EOF
24+
25+
RUN useradd -u 8877 -m aws-user
26+
RUN useradd -u 1001 -m github-user
27+
USER github-user

docker/emscriptenDockerfile

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,8 @@ COPY --from=builder /opt/meshlib-thirdparty/emscripten /usr/local/lib/ems
6565
COPY --from=builder /opt/meshlib-thirdparty/emscripten-single /usr/local/lib/emscripten-single
6666
COPY --from=builder /opt/meshlib-thirdparty/emscripten-wasm64 /usr/local/lib/emscripten-wasm64
6767

68-
# Setup non-root user (use 1001 to play nicely with actions/checkout@v4)
69-
# https://github.com/actions/checkout/issues/1014
70-
RUN <<EOF
71-
set -e
72-
groupadd -g 1001 user
73-
useradd -m -u 1001 -g user -s /bin/bash user
74-
chmod -R 777 /emsdk/upstream/emscripten/
75-
EOF
68+
RUN chmod -R 777 /emsdk/upstream/emscripten/
7669

77-
# Change to non-root privilege
78-
USER user
70+
RUN useradd -u 8877 -m aws-user
71+
RUN useradd -u 1001 -m github-user
72+
USER github-user

0 commit comments

Comments
 (0)