First login: create docker group and add normal user to it (#8920)
* First login: create docker group and add normal user to it * Update packages/bsp/common/usr/lib/armbian/armbian-firstlogin Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
This commit is contained in:
parent
758c57bafe
commit
347a93f3bd
@ -600,7 +600,16 @@ add_user() {
|
||||
else
|
||||
passwd -d "$RealUserName" > /dev/null 2>&1
|
||||
fi
|
||||
for additionalgroup in sudo netdev audio video disk tty users games dialout plugdev input bluetooth systemd-journal ssh render; do
|
||||
|
||||
# Pre-create docker group to ensure user membership is set up before Docker installation.
|
||||
# (docker-ce package creates this group automatically during postinst, but we create it early
|
||||
# to guarantee group membership is ready immediately after user creation.)
|
||||
if ! getent group docker >/dev/null; then
|
||||
if ! addgroup --system docker 2>/dev/null; then
|
||||
echo "Warning: Failed to create docker group" >&2
|
||||
fi
|
||||
fi
|
||||
for additionalgroup in sudo netdev audio video disk tty users games dialout plugdev input bluetooth systemd-journal ssh render docker; do
|
||||
usermod -aG "${additionalgroup}" "${RealUserName}" 2> /dev/null
|
||||
done
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user