From 741403e1576d1b7d3822fda88c88e724a0b35178 Mon Sep 17 00:00:00 2001 From: Mike Delago <32778141+michaeldelago@users.noreply.github.com> Date: Sat, 12 Aug 2023 15:01:49 -0400 Subject: [PATCH] fix(Apps/Docker): adduser/addgroup commands in dockerfile (#14914) Fix useradds in dockerfile --- apps/docker/Dockerfile | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/apps/docker/Dockerfile b/apps/docker/Dockerfile index fca5ec0782a492..08061efaefd080 100644 --- a/apps/docker/Dockerfile +++ b/apps/docker/Dockerfile @@ -44,10 +44,10 @@ RUN git config --global --add safe.directory /azerothcore RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone && dpkg-reconfigure --frontend noninteractive tzdata # Create a non-root user -RUN addgroup --gid $GROUP_ID acore && \ - adduser --disabled-password --gecos '' --uid $USER_ID --gid $GROUP_ID acore && \ - passwd -d acore && \ - echo 'acore ALL=(ALL:ALL) NOPASSWD: ALL' >> /etc/sudoers +RUN addgroup --gid "$GROUP_ID" "$DOCKER_USER" && \ + adduser --disabled-password --gecos '' --uid "$USER_ID" --gid "$GROUP_ID" "$DOCKER_USER" && \ + passwd -d "$DOCKER_USER" && \ + echo "$DOCKER_USER ALL=(ALL:ALL) NOPASSWD: ALL" >> /etc/sudoers # must be created to set the correct permissions on them RUN mkdir -p /azerothcore/env/dist/bin @@ -128,10 +128,10 @@ ENV TZ=Etc/UTC ENV DEBIAN_FRONTEND=noninteractive # Create a non-root user -RUN addgroup --gid $GROUP_ID acore && \ - adduser --disabled-password --gecos '' --uid $USER_ID --gid $GROUP_ID acore && \ - passwd -d acore && \ - echo 'acore ALL=(ALL:ALL) NOPASSWD: ALL' >> /etc/sudoers +RUN addgroup --gid "$GROUP_ID" "$DOCKER_USER" && \ + adduser --disabled-password --gecos '' --uid "$USER_ID" --gid "$GROUP_ID" "$DOCKER_USER" && \ + passwd -d "$DOCKER_USER" && \ + echo "$DOCKER_USER ALL=(ALL:ALL) NOPASSWD: ALL" >> /etc/sudoers # install the required dependencies to run the server RUN apt-get update && apt-get install -y dos2unix gdb gdbserver google-perftools libgoogle-perftools-dev net-tools \ @@ -285,10 +285,10 @@ ENV TZ=Etc/UTC # set noninteractive mode so tzdata doesn't ask to set timezone on install ENV DEBIAN_FRONTEND=noninteractive -RUN addgroup --gid $GROUP_ID acore && \ - adduser --disabled-password --gecos '' --uid $USER_ID --gid $GROUP_ID acore && \ - passwd -d acore && \ - echo 'acore ALL=(ALL:ALL) NOPASSWD: ALL' >> /etc/sudoers +RUN addgroup --gid "$GROUP_ID" "$DOCKER_USER" && \ + adduser --disabled-password --gecos '' --uid "$USER_ID" --gid "$GROUP_ID" "$DOCKER_USER" && \ + passwd -d "$DOCKER_USER" && \ + echo "$DOCKER_USER ALL=(ALL:ALL) NOPASSWD: ALL" >> /etc/sudoers # ENV DATAPATH=/azerothcore/env/dist/data-temp ENV DATAPATH=/azerothcore/env/dist/data @@ -327,10 +327,10 @@ RUN apt-get update && apt-get install -y libmysqlclient-dev libssl-dev libbz2-de sudo && rm -rf /var/lib/apt/lists/* ; # Create a non-root user -RUN addgroup --gid $GROUP_ID acore && \ - adduser --disabled-password --gecos '' --uid $USER_ID --gid $GROUP_ID acore && \ - passwd -d acore && \ - echo 'acore ALL=(ALL:ALL) NOPASSWD: ALL' >> /etc/sudoers +RUN addgroup --gid "$GROUP_ID" "$DOCKER_USER" && \ + adduser --disabled-password --gecos '' --uid "$USER_ID" --gid "$GROUP_ID" "$DOCKER_USER" && \ + passwd -d "$DOCKER_USER" && \ + echo "$DOCKER_USER ALL=(ALL:ALL) NOPASSWD: ALL" >> /etc/sudoers RUN mkdir -p /azerothcore/env/client/ RUN chown -R $DOCKER_USER:$DOCKER_USER /azerothcore