From 4ac3aa08f0022d0155f9083af97a7bcbd5173e4a Mon Sep 17 00:00:00 2001 From: ashmrtn <3891298+ashmrtn@users.noreply.github.com> Date: Mon, 9 May 2022 17:20:03 -0700 Subject: [PATCH] Fix building base image on Mac. (#22) Mac uses low group IDs for the default user, which would cause groupadd to fail as the group already existed. Only make a new group if it doesn't already exist. This does raise other questions though as now we are technically having the container run with a "services" group. --- docker/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index b74c2b405..562c6521a 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -8,7 +8,7 @@ ARG gid=1000 # with the same UID and GID as the current user so that the mounted directory # doesn't end up with files with strange permissions. -RUN groupadd -g "${gid}" build && \ +RUN if [ ! $(getent group ${gid}) ]; then groupadd -g "${gid}" build; fi && \ useradd -m -u "${uid}" -g "${gid}" build -USER build:build +USER build:${gid}