I think that this code, 404 to 416 in alpine-chroot-install,
./enter-chroot <<-EOF
set -e
apk update
apk add $ALPINE_PACKAGES
if [ -d /etc/sudoers.d ] && [ ! -e /etc/sudoers.d/wheel ]; then
echo '%wheel ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/wheel
fi
if [ -n "${SUDO_USER:-}" ]; then
adduser -u "${SUDO_UID:-1000}" -G users -s /bin/sh -D "${SUDO_USER:-}" || true
fi
EOF
is supposed to setup the user running the command as "sudo" capable if the "sudo" package is included with -p sudo. At the moment this fails because the user isn't added the wheel group.
I think that this line
adduser -u "${SUDO_UID:-1000}" -G users -s /bin/sh -D "${SUDO_USER:-}" || true
should be
adduser -u "${SUDO_UID:-1000}" -G users,wheel -s /bin/sh -D "${SUDO_USER:-}" || true
As an aside, I thought that the preferred option was to use doas in Alpine and not sudo.
My current manual workaround is to add the user to the wheel group in /etc/group after script completion.
I think that this code, 404 to 416 in
alpine-chroot-install,is supposed to setup the user running the command as "sudo" capable if the "sudo" package is included with
-p sudo. At the moment this fails because the user isn't added thewheelgroup.I think that this line
adduser -u "${SUDO_UID:-1000}" -G users -s /bin/sh -D "${SUDO_USER:-}" || trueshould be
adduser -u "${SUDO_UID:-1000}" -G users,wheel -s /bin/sh -D "${SUDO_USER:-}" || trueAs an aside, I thought that the preferred option was to use
doasin Alpine and notsudo.My current manual workaround is to add the user to the
wheelgroup in/etc/groupafter script completion.