Skip to content

Commit b3be2a0

Browse files
committed
build: fix regression: support local dev builds also using UID!=1000
- both "ELECBUILD_COMMIT fresh_clone builds" and "local dev builds" should work even when the unix user has a different UID than 1000 on the host machine - though I guess running as root does not work but that's prob ok issue was: ``` $ echo $UID 1111 $ ./contrib/build-linux/appimage/build.sh 🗯 ERROR: Building outside a git clone is not supported. ```
1 parent 4800573 commit b3be2a0

4 files changed

Lines changed: 8 additions & 8 deletions

File tree

contrib/android/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,8 @@ RUN apt -y update -qq \
196196

197197

198198
# create new user to avoid using root; but with sudo access and no password for convenience.
199-
# NOTE: UID *MUST* align with buildozer's Dockerfile "user"
200-
RUN useradd -u 1000 -m -s /usr/bin/bash -d /home/user user
199+
ARG UID=1000
200+
RUN useradd -u "$UID" -m -s /usr/bin/bash -d /home/user user
201201
RUN usermod -aG sudo user
202202
RUN echo "%sudo ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
203203
ENV HOME_DIR=/home/user

contrib/build-linux/appimage/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ RUN apt-get update -q && \
7474
apt-get clean
7575

7676
# create new user to avoid using root; but with sudo access and no password for convenience.
77-
# NOTE: UID *MUST* align with buildozer's Dockerfile "user"
78-
RUN useradd -u 1000 -m -s /usr/bin/bash -d /home/user user
77+
ARG UID=1000
78+
RUN useradd -u "$UID" -m -s /usr/bin/bash -d /home/user user
7979
RUN usermod -aG sudo user
8080
RUN echo "%sudo ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
8181
ENV HOME_DIR=/home/user

contrib/build-linux/sdist/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ RUN apt-get update -q && \
1717
apt-get clean
1818

1919
# create new user to avoid using root; but with sudo access and no password for convenience.
20-
# NOTE: UID *MUST* align with buildozer's Dockerfile "user"
21-
RUN useradd -u 1000 -m -s /usr/bin/bash -d /home/user user
20+
ARG UID=1000
21+
RUN useradd -u "$UID" -m -s /usr/bin/bash -d /home/user user
2222
RUN usermod -aG sudo user
2323
RUN echo "%sudo ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
2424
ENV HOME_DIR=/home/user

contrib/build-wine/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ RUN DEBIAN_CODENAME=$(lsb_release --codename --short) && \
5757
apt-get clean
5858

5959
# create new user to avoid using root; but with sudo access and no password for convenience.
60-
# NOTE: UID *MUST* align with buildozer's Dockerfile "user"
61-
RUN useradd -u 1000 -m -s /usr/bin/bash -d /home/user user
60+
ARG UID=1000
61+
RUN useradd -u "$UID" -m -s /usr/bin/bash -d /home/user user
6262
RUN usermod -aG sudo user
6363
RUN echo "%sudo ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
6464
ENV HOME_DIR=/home/user

0 commit comments

Comments
 (0)