Shift "ubuntu" user removal to base build.

This commit is contained in:
Alex Vandiver
2024-09-09 16:31:38 -04:00
parent e6b60181d8
commit 76afe5fb46

View File

@@ -13,14 +13,13 @@ RUN { [ ! "$UBUNTU_MIRROR" ] || sed -i "s|http://\(\w*\.\)*archive\.ubuntu\.com/
apt-get -q update && \
apt-get -q dist-upgrade -y && \
DEBIAN_FRONTEND=noninteractive \
apt-get -q install --no-install-recommends -y ca-certificates git locales python3 sudo tzdata
apt-get -q install --no-install-recommends -y ca-certificates git locales python3 sudo tzdata && \
touch /var/mail/ubuntu && chown ubuntu /var/mail/ubuntu && userdel -r ubuntu && \
useradd -d /home/zulip -m zulip -u 1000
FROM base AS build
RUN touch /var/mail/ubuntu && chown ubuntu /var/mail/ubuntu && userdel -r ubuntu && \
useradd -d /home/zulip -m zulip -u 1000 && \
echo 'zulip ALL=(ALL:ALL) NOPASSWD:ALL' >> /etc/sudoers
RUN echo 'zulip ALL=(ALL:ALL) NOPASSWD:ALL' >> /etc/sudoers
USER zulip
WORKDIR /home/zulip