~dvshkn/docker-anaconda-py3

714559dbdb85ba07074848378253eedcd7d2d24e — David Knight 1 year, 2 months ago aff52e3
update Dockerfile to handle macos staff group (gid collision)
1 files changed, 6 insertions(+), 2 deletions(-)

M Dockerfile
M Dockerfile => Dockerfile +6 -2
@@ 11,8 11,12 @@ RUN apt-get update
RUN apt-get upgrade -y
RUN apt-get install -y sudo vim

# setup regular user
RUN groupadd --gid $gid user
# setup the login group
# - create new group if the gid isn't taken (usual case on linux host)
# - commandeer the group if the gid is taken (usual case on macos host)
RUN EXISTING_GROUP=$(cat /etc/group | grep ":$gid:" | awk '{split($0,s,":"); print s[1]}'); [[ $EXISTING_GROUP ]] && groupmod --new-name user $EXISTING_GROUP || groupadd --gid $gid user

# finally setup regular user
RUN groupadd wheel
RUN useradd -m -s /bin/bash --uid $uid --gid $gid -G wheel user
RUN echo 'user:docker' | chpasswd