Dockerfile: move useradd after ARGs

This commit is contained in:
2024-04-08 20:48:31 +02:00
parent ec3d514d7b
commit cde61c13d3

View File

@@ -93,6 +93,11 @@ ARG TB_VERSION=${TB_VERSION}
ARG XDG_CONFIG_HOME=${XDG_CONFIG_HOME} ARG XDG_CONFIG_HOME=${XDG_CONFIG_HOME}
ARG XDG_RUNTIME_DIR=${XDG_RUNTIME_DIR} ARG XDG_RUNTIME_DIR=${XDG_RUNTIME_DIR}
## Add the user with default password
RUN groupadd -g "${USER_GROUP_ID}" "${USER_GROUP}" && \
useradd -m -u "${USER_ID}" -g "${USER_GROUP_ID}" -s /bin/bash "${USER}" && \
echo "${USER}:${USER_PASSWORD}" | chpasswd
## Set the desired Locale ## Set the desired Locale
RUN locale-gen ${LOCALE_LANG} && \ RUN locale-gen ${LOCALE_LANG} && \
dpkg-reconfigure --frontend=noninteractive locales && \ dpkg-reconfigure --frontend=noninteractive locales && \
@@ -148,11 +153,6 @@ RUN mkdir /var/run/sshd && \
### Set timzone ### Set timzone
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
## Add the user with default password
RUN groupadd -g "${USER_GROUP_ID}" "${USER_GROUP}" && \
useradd -m -u "${USER_ID}" -g "${USER_GROUP_ID}" -s /bin/bash "${USER}" && \
echo "${USER}:${USER_PASSWORD}" | chpasswd
## Lighttpd setup and create the runit service for lighttpd ## Lighttpd setup and create the runit service for lighttpd
ENV LIGHTTPD_RUN="/etc/service/lighttpd/run" ENV LIGHTTPD_RUN="/etc/service/lighttpd/run"
ENV LIGHTTPD_CONFIG_PATH="/config/lighttpd" ENV LIGHTTPD_CONFIG_PATH="/config/lighttpd"