From ac7a82f0ca59f5bffd0511e0cebd8f6c221632f6 Mon Sep 17 00:00:00 2001 From: Alejandro Lembke Barrientos Date: Thu, 15 Feb 2024 18:41:29 +0000 Subject: [PATCH] Trying to fix issue. Updating to version 2.0.6 --- entrypoint.sh | 11 +++++++---- version.txt | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 6076438..851a168 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -13,16 +13,19 @@ fi # Otherwise the current container UID may not exist in the passwd database. eval "$(fixuid -q)" -if [ "${DOCKER_USER-}" ]; then - USER="$DOCKER_USER" - if [ "$DOCKER_USER" != "$(whoami)" ]; then - echo "$DOCKER_USER ALL=(ALL) NOPASSWD:ALL" | sudo tee -a /etc/sudoers.d/nopasswd > /dev/null +if [ "${HOME_USER-}" ]; then + USER="$HOME_USER" + if [ "$HOME_USER" != "$(whoami)" ]; then + adduser --disabled-password --gecos "" ${HOME_USER} + echo "$HOME_USER ALL=(ALL) NOPASSWD:ALL" | sudo tee -a /etc/sudoers.d/nopasswd > /dev/null + su - $HOME_USER # Unfortunately we cannot change $HOME as we cannot move any bind mounts # nor can we bind mount $HOME into a new home as that requires a privileged container. sudo usermod --login "$DOCKER_USER" vscode sudo groupmod -n "$DOCKER_USER" vscode sudo sed -i "/vscode/d" /etc/sudoers.d/nopasswd + sudo cd /home/${HOME_USER} fi fi diff --git a/version.txt b/version.txt index b9d2bdf..703cec9 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -2.0.5 \ No newline at end of file +2.0.6 \ No newline at end of file