adduser: useradd --no-log-init to reduce lastlog size
If the Docker host does not support sparse files /var/log/lastlog can be extremely large if a large UID is set. --no-log-init prevents lastlog being created.
@@ -42,8 +42,15 @@ ARG NB_UID
ENV USER ${NB_USER}
ENV HOME /home/${NB_USER}
-RUN adduser --disabled-password \
- --gecos "Default user" \
+RUN groupadd \
+ --gid ${NB_UID} \
+ ${NB_USER} &&
+ useradd \
+ --comment "Default user" \
+ --create-home \
+ --gid ${NB_UID} \
+ --no-log-init \
+ --shell /bin/bash \
--uid ${NB_UID} \
${NB_USER}
