Skip to content

Commit c55d69c

Browse files
committed
riotdocker-base,riotbuild: fix user group setting, add git-cache-rs
1 parent 9882a0b commit c55d69c

3 files changed

Lines changed: 13 additions & 2 deletions

File tree

riotbuild/Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,11 @@ RUN \
348348
# get laze binary
349349
COPY --from=kaspar030/laze:0.1.20-jammy /laze /usr/bin/laze
350350

351+
# get git-cache-rs binary and set the environment variable for
352+
# the RIOT package subsystem
353+
COPY --from=ghcr.io/kaspar030/git-cache:0.2.8-jammy /git-cache /usr/bin/git-cache
354+
ENV GIT_CACHE_RS /usr/bin/git-cache
355+
351356
# get Dockerfile version from build args
352357
ARG RIOTBUILD_VERSION=unknown
353358
ENV RIOTBUILD_VERSION $RIOTBUILD_VERSION

riotdocker-base/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ RUN \
2020
COPY create_user.c /tmp/create_user.c
2121
RUN gcc -DHOMEDIR=\"/data/riotbuild\" -DUSERNAME=\"riotbuild\" /tmp/create_user.c -o /usr/local/bin/create_user \
2222
&& chown root:root /usr/local/bin/create_user \
23-
&& chmod u=rws,g=x,o=- /usr/local/bin/create_user \
23+
&& chmod u=rws,g=x,o=x /usr/local/bin/create_user \
2424
&& rm /tmp/create_user.c
2525

2626
# Create working directory for mounting the RIOT sources

riotdocker-base/create_user.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,13 @@ int main(int argc, char *argv[])
1414
unsigned uid = atoi(argv[1]);
1515
char buf[128];
1616

17-
sprintf(buf, "/usr/sbin/useradd -u %u -d %s -r -g 0 -N %s", uid, HOMEDIR, USERNAME);
17+
/* create the usergroup */
18+
sprintf(buf, "/usr/sbin/groupadd -g %u %s", uid, USERNAME);
1819
system(buf);
20+
21+
/* set the UID, Home Directory, User Group */
22+
sprintf(buf, "/usr/sbin/useradd -u %u -d %s -g %u %s", uid, HOMEDIR, uid, USERNAME);
23+
system(buf);
24+
1925
return 0;
2026
}

0 commit comments

Comments
 (0)