Compare commits

...

3 Commits
2.0.4 ... 2.0.7

3 changed files with 8 additions and 5 deletions

View File

@ -44,7 +44,7 @@ RUN sudo sysctl -w fs.inotify.max_user_watches=524288
ADD ./entrypoint.sh /usr/bin/entrypoint.sh ADD ./entrypoint.sh /usr/bin/entrypoint.sh
RUN sudo chmod +x /usr/bin/entrypoint.sh RUN sudo chmod +x /usr/bin/entrypoint.sh
#USER 1000 USER 1000
ENV USER=vscode ENV USER=vscode
WORKDIR /home/vscode WORKDIR /home/vscode

View File

@ -16,13 +16,16 @@ eval "$(fixuid -q)"
if [ "${HOME_USER-}" ]; then if [ "${HOME_USER-}" ]; then
USER="$HOME_USER" USER="$HOME_USER"
if [ "$HOME_USER" != "$(whoami)" ]; then if [ "$HOME_USER" != "$(whoami)" ]; then
echo "$HOME_USER ALL=(ALL) NOPASSWD:ALL" | sudo tee -a /etc/sudoers.d/nopasswd > /dev/null sudo adduser --disabled-password --gecos "" ${HOME_USER}
sudo 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 # 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. # nor can we bind mount $HOME into a new home as that requires a privileged container.
sudo usermod --login "$HOME_USER" vscode sudo usermod --login "$DOCKER_USER" vscode
sudo groupmod -n "$HOME_USER" vscode sudo groupmod -n "$DOCKER_USER" vscode
sudo sed -i "/vscode/d" /etc/sudoers.d/nopasswd sudo sed -i "/vscode/d" /etc/sudoers.d/nopasswd
sudo cd /home/${HOME_USER}
fi fi
fi fi

View File

@ -1 +1 @@
2.0.4 2.0.7