Skip to content

Commit

Permalink
Allow using dev images as root
Browse files Browse the repository at this point in the history
Don't abort the entrypoint script if the user-id already exists.
This allows using the dev images as root or when using Podman,
which does some user mapping already.

This should fix #76

Signed-off-by: Oliver Steffen <[email protected]>
  • Loading branch information
osteffenrh committed Dec 6, 2023
1 parent 3625d04 commit 45108ea
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Fedora-35/fedora35_dev_entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,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}" -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 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}" -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 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}" -u "${user_uid}" -g "${user_gid}" \
useradd "${EDK2_DOCKER_USER}" -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}" -o -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}" -o -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 45108ea

Please sign in to comment.