Skip to content

Commit dd2e9fc

Browse files
authored
Fix user rename when restarting container (coder#7012)
1 parent bea906f commit dd2e9fc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ci/release-image/entrypoint.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ eval "$(fixuid -q)"
77

88
if [ "${DOCKER_USER-}" ]; then
99
USER="$DOCKER_USER"
10-
if [ "$DOCKER_USER" != "$(whoami)" ]; then
10+
if [ -z "$(id -u "$DOCKER_USER" 2>/dev/null)" ]; then
1111
echo "$DOCKER_USER ALL=(ALL) NOPASSWD:ALL" | sudo tee -a /etc/sudoers.d/nopasswd > /dev/null
1212
# Unfortunately we cannot change $HOME as we cannot move any bind mounts
1313
# nor can we bind mount $HOME into a new home as that requires a privileged container.

0 commit comments

Comments
 (0)