mirror of
https://github.com/aleleba/aleleba-vscode-dockerfile-configuration.git
synced 2025-06-19 04:18:11 -06:00
Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
8e9ef7bfa9 | |||
762ff44dc8 | |||
ac7a82f0ca |
@ -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
|
||||
sudo adduser --disabled-password --gecos "" ${HOME_USER}
|
||||
sudo echo "$HOME_USER ALL=(ALL) NOPASSWD:ALL" | sudo tee -a /etc/sudoers.d/nopasswd > /dev/null
|
||||
sudo -u $HOME_USER -i
|
||||
# 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 usermod --login "$HOME_USER" vscode
|
||||
sudo groupmod -n "$HOME_USER" vscode
|
||||
|
||||
sudo sed -i "/vscode/d" /etc/sudoers.d/nopasswd
|
||||
sudo cd /home/${HOME_USER}
|
||||
fi
|
||||
fi
|
||||
|
||||
|
@ -1 +1 @@
|
||||
2.0.5
|
||||
2.0.8
|
Reference in New Issue
Block a user