From 9bac2433a61b4269483663a076570a64bfe9eac8 Mon Sep 17 00:00:00 2001 From: Alejandro Lembke Barrientos Date: Thu, 15 Feb 2024 06:23:40 +0000 Subject: [PATCH] Trying to fix. Updating to version 2.0.5 --- Dockerfile | 2 +- entrypoint.sh | 12 ++++++------ version.txt | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index 9b7705a..22c6d10 100644 --- a/Dockerfile +++ b/Dockerfile @@ -44,7 +44,7 @@ RUN sudo sysctl -w fs.inotify.max_user_watches=524288 ADD ./entrypoint.sh /usr/bin/entrypoint.sh RUN sudo chmod +x /usr/bin/entrypoint.sh -#USER 1000 +USER 1000 ENV USER=vscode WORKDIR /home/vscode diff --git a/entrypoint.sh b/entrypoint.sh index a09c284..6076438 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -13,14 +13,14 @@ fi # Otherwise the current container UID may not exist in the passwd database. eval "$(fixuid -q)" -if [ "${HOME_USER-}" ]; then - USER="$HOME_USER" - if [ "$HOME_USER" != "$(whoami)" ]; then - echo "$HOME_USER ALL=(ALL) NOPASSWD:ALL" | sudo tee -a /etc/sudoers.d/nopasswd > /dev/null +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 # 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 "$HOME_USER" vscode - sudo groupmod -n "$HOME_USER" vscode + sudo usermod --login "$DOCKER_USER" vscode + sudo groupmod -n "$DOCKER_USER" vscode sudo sed -i "/vscode/d" /etc/sudoers.d/nopasswd fi diff --git a/version.txt b/version.txt index 26e3379..b9d2bdf 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -2.0.4 \ No newline at end of file +2.0.5 \ No newline at end of file