Skip to content

Commit

Permalink
fix(Apps/Docker): adduser/addgroup commands in dockerfile (azerothcor…
Browse files Browse the repository at this point in the history
…e#14914)

Fix useradds in dockerfile
  • Loading branch information
michaeldelago committed Aug 12, 2023
1 parent 986767a commit 741403e
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions apps/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 \
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 741403e

Please sign in to comment.