Use fixuid to resolve user perm conflicts in mounted dirs

It matches the user permissions in the container to those in the host. This has
clear advantages to our previous solution, which matched the permissions in the
image. One immediate benefit is that the jenkins server-build node can pull the
image from Docker Hub, rather than build it on the host (for each build, to
ensure the image is up-to-date).
This commit is contained in:
John Colvin authored and johncolvin-og committed 2022-09-11 01:01:05 -04:00
1 parent 191d74b404
commit 226ccdfd9b
1 file changed
+7 -8
+7 -8
View File
@@ -295,11 +295,10 @@ RUN \
pkg-config
########################
ARG docker_user
ARG docker_user_id
ARG docker_password
RUN \
useradd -u $docker_user_id -m $docker_user \
&& echo "${docker_user}:${docker_password}" \
| chpasswd && adduser $docker_user sudo
RUN USER=docker && \
GROUP=docker && \
curl -SsL https://github.com/boxboat/fixuid/releases/download/v0.5.1/fixuid-0.5.1-linux-amd64.tar.gz | tar -C /usr/local/bin -xzf - && \
chown root:root /usr/local/bin/fixuid && \
chmod 4755 /usr/local/bin/fixuid && \
mkdir -p /etc/fixuid && \
printf "user: $USER\ngroup: $GROUP\n" > /etc/fixuid/config.yml