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.
This commit is contained in:
parent
82c9a1f182
commit
4ac3aa08f0
@ -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}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user