Skip to content

Commit

Permalink
Add -l (--no-log-init) to useradd commands to avoid creating huge files
Browse files Browse the repository at this point in the history
Without the -l (--no-log-init) parameter when running useradd, it can
create huge /var/log/faillog and /var/log/lastlog files since it reserves
space for all users between 0 and the UID.

See docker/hub-feedback#2263 (comment)
for more information.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
  • Loading branch information
bcran committed May 24, 2024
1 parent 7c55b53 commit a681286
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Fedora-37/fedora37_dev_entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ user_gid=$(stat -c "%g" "${EDK2_DOCKER_USER_HOME}")
groupadd "${EDK2_DOCKER_USER}" -f -o -g "${user_gid}"
#
# - Add the user.
useradd "${EDK2_DOCKER_USER}" -u "${user_uid}" -g "${user_gid}" \
useradd "${EDK2_DOCKER_USER}" -l -u "${user_uid}" -g "${user_gid}" \
-G wheel -d "${EDK2_DOCKER_USER_HOME}" -M -s /bin/bash

echo "${EDK2_DOCKER_USER}":tianocore | chpasswd
Expand Down
2 changes: 1 addition & 1 deletion Fedora-39/fedora39_dev_entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ user_gid=$(stat -c "%g" "${EDK2_DOCKER_USER_HOME}")
groupadd "${EDK2_DOCKER_USER}" -f -o -g "${user_gid}"
#
# - Add the user.
useradd "${EDK2_DOCKER_USER}" -o -u "${user_uid}" -g "${user_gid}" \
useradd "${EDK2_DOCKER_USER}" -l -o -u "${user_uid}" -g "${user_gid}" \
-G wheel -d "${EDK2_DOCKER_USER_HOME}" -M -s /bin/bash

echo "${EDK2_DOCKER_USER}":tianocore | chpasswd
Expand Down
2 changes: 1 addition & 1 deletion Ubuntu-20/ubuntu20_dev_entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ user_gid=$(stat -c "%g" "${EDK2_DOCKER_USER_HOME}")
groupadd "${EDK2_DOCKER_USER}" -f -o -g "${user_gid}"
#
# - Add the user.
useradd "${EDK2_DOCKER_USER}" -u "${user_uid}" -g "${user_gid}" \
useradd "${EDK2_DOCKER_USER}" -l -u "${user_uid}" -g "${user_gid}" \
-G sudo -d "${EDK2_DOCKER_USER_HOME}" -M -s /bin/bash

echo "${EDK2_DOCKER_USER}":tianocore | chpasswd
Expand Down
2 changes: 1 addition & 1 deletion Ubuntu-22/ubuntu22_dev_entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ user_gid=$(stat -c "%g" "${EDK2_DOCKER_USER_HOME}")
groupadd "${EDK2_DOCKER_USER}" -f -o -g "${user_gid}"
#
# - Add the user.
useradd "${EDK2_DOCKER_USER}" -u "${user_uid}" -g "${user_gid}" \
useradd "${EDK2_DOCKER_USER}" -l -u "${user_uid}" -g "${user_gid}" \
-G sudo -d "${EDK2_DOCKER_USER_HOME}" -M -s /bin/bash

echo "${EDK2_DOCKER_USER}":tianocore | chpasswd
Expand Down

0 comments on commit a681286

Please sign in to comment.