File tree Expand file tree Collapse file tree 6 files changed +30
-6
lines changed Expand file tree Collapse file tree 6 files changed +30
-6
lines changed Original file line number Diff line number Diff line change 5
5
6
6
FROM debian:11
7
7
8
+ # Optionally override uid of default user in container, e.g.,
9
+ # docker build --build-arg uid=1001 ...
10
+ ARG uid
11
+
8
12
WORKDIR /work
9
13
10
14
# Before using a new script, update .github/workflows/container.yml
@@ -32,7 +36,7 @@ RUN dpkg --add-architecture armhf \
32
36
libelf-dev:armhf \
33
37
zlib1g-dev:armhf \
34
38
&& apt-get -y clean \
35
- && useradd --system --user-group --shell /sbin/nologin --create-home --home-dir /home/build build \
39
+ && useradd --system ${uid:+--uid "$uid" } --user-group --shell /sbin/nologin --create-home --home-dir /home/build build \
36
40
&& echo 'build ALL=(ALL) NOPASSWD:ALL' > /etc/sudoers.d/build \
37
41
&& rm -rf "$PWD"
38
42
Original file line number Diff line number Diff line change 5
5
6
6
FROM opensuse/leap:15
7
7
8
+ # Optionally override uid of default user in container, e.g.,
9
+ # docker build --build-arg uid=1001 ...
10
+ ARG uid
11
+
8
12
WORKDIR /work
9
13
10
14
# Before using a new script, update .github/workflows/container.yml
@@ -32,7 +36,7 @@ RUN zypper -n update \
32
36
zlib-devel \
33
37
&& zypper -n clean \
34
38
&& ./install_aocl.sh /opt/aocl \
35
- && useradd --system --user-group --shell /sbin/nologin --create-home --home-dir /home/build build \
39
+ && useradd --system ${uid:+--uid "$uid" } --user-group --shell /sbin/nologin --create-home --home-dir /home/build build \
36
40
&& echo 'build ALL=(ALL) NOPASSWD:ALL' > /etc/sudoers.d/build \
37
41
&& rm -rf "$PWD"
38
42
Original file line number Diff line number Diff line change 5
5
6
6
FROM rockylinux:8
7
7
8
+ # Optionally override uid of default user in container, e.g.,
9
+ # docker build --build-arg uid=1001 ...
10
+ ARG uid
11
+
8
12
WORKDIR /work
9
13
10
14
# Before using a new script, update .github/workflows/container.yml
38
42
zlib-devel \
39
43
&& yum -y clean all \
40
44
&& ./install_aocl.sh /opt/aocl \
41
- && useradd --system --user-group --shell /sbin/nologin --create-home --home-dir /home/build build \
45
+ && useradd --system ${uid:+--uid "$uid" } --user-group --shell /sbin/nologin --create-home --home-dir /home/build build \
42
46
&& echo 'build ALL=(ALL) NOPASSWD:ALL' > /etc/sudoers.d/build \
43
47
&& rm -rf "$PWD"
44
48
Original file line number Diff line number Diff line change 5
5
6
6
FROM ubuntu:18.04
7
7
8
+ # Optionally override uid of default user in container, e.g.,
9
+ # docker build --build-arg uid=1001 ...
10
+ ARG uid
11
+
8
12
WORKDIR /work
9
13
10
14
# Before using a new script, update .github/workflows/container.yml
@@ -41,7 +45,7 @@ RUN apt-get -y update \
41
45
zlib1g-dev \
42
46
&& apt-get -y clean \
43
47
&& ./install_aocl.sh /opt/aocl \
44
- && useradd --system --user-group --shell /sbin/nologin --create-home --home-dir /home/build build \
48
+ && useradd --system ${uid:+--uid "$uid" } --user-group --shell /sbin/nologin --create-home --home-dir /home/build build \
45
49
&& echo 'build ALL=(ALL) NOPASSWD:ALL' > /etc/sudoers.d/build \
46
50
&& rm -rf "$PWD"
47
51
Original file line number Diff line number Diff line change @@ -12,6 +12,10 @@ ARG clang_archive_sig=$clang_archive.sig
12
12
ARG clang_archive_url=https://github.com/llvm/llvm-project/releases/download/llvmorg-$clang_version/$clang_archive
13
13
ARG clang_archive_sig_url=$clang_archive_url.sig
14
14
15
+ # Optionally override uid of default user in container, e.g.,
16
+ # docker build --build-arg uid=1001 ...
17
+ ARG uid
18
+
15
19
WORKDIR /work
16
20
17
21
# https://releases.llvm.org/download.html
@@ -33,7 +37,7 @@ RUN apt-get -y update \
33
37
&& tar --strip-components=1 -C "$clang_installdir" -xf "$clang_archive" \
34
38
&& chown -R root:root "$clang_installdir" \
35
39
&& chmod -R u=rwX,g=rX,o=rX "$clang_installdir" \
36
- && useradd --system --user-group --shell /sbin/nologin --create-home --home-dir /home/build build \
40
+ && useradd --system ${uid:+--uid "$uid" } --user-group --shell /sbin/nologin --create-home --home-dir /home/build build \
37
41
&& echo 'build ALL=(ALL) NOPASSWD:ALL' > /etc/sudoers.d/build \
38
42
&& rm -rf "$PWD"
39
43
Original file line number Diff line number Diff line change 5
5
6
6
FROM ubuntu:20.04
7
7
8
+ # Optionally override uid of default user in container, e.g.,
9
+ # docker build --build-arg uid=1001 ...
10
+ ARG uid
11
+
8
12
WORKDIR /work
9
13
10
14
# Before using a new script, update .github/workflows/container.yml
@@ -28,7 +32,7 @@ RUN apt-get -y update \
28
32
zlib1g-dev \
29
33
&& apt-get -y clean \
30
34
&& ./install_aocl.sh /opt/aocl \
31
- && useradd --system --user-group --shell /sbin/nologin --create-home --home-dir /home/build build \
35
+ && useradd --system ${uid:+--uid "$uid" } --user-group --shell /sbin/nologin --create-home --home-dir /home/build build \
32
36
&& echo 'build ALL=(ALL) NOPASSWD:ALL' > /etc/sudoers.d/build \
33
37
&& rm -rf "$PWD"
34
38
You can’t perform that action at this time.
0 commit comments