mirror of
https://github.com/aleleba/aleleba-vscode-dockerfile-configuration.git
synced 2025-06-19 04:18:11 -06:00
Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
6525dc4c7e
|
|||
b3609b3d0b
|
|||
dd283a2c5f
|
|||
18fe10675c
|
19
entrypoint.sh
Normal file → Executable file
19
entrypoint.sh
Normal file → Executable file
@ -20,6 +20,10 @@ if [ "${HOME_USER-}" ]; then
|
|||||||
sudo adduser --disabled-password --gecos "" ${HOME_USER}
|
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 echo "$HOME_USER ALL=(ALL) NOPASSWD:ALL" | sudo tee -a /etc/sudoers.d/nopasswd > /dev/null
|
||||||
fi
|
fi
|
||||||
|
# Copy environment variables from vscode user to HOME_USER
|
||||||
|
env | grep -v 'HOME_USER' | while read -r line; do
|
||||||
|
sudo su - ${HOME_USER} -c "echo 'export $line' >> ~/.bashrc"
|
||||||
|
done
|
||||||
sudo -u $HOME_USER -i
|
sudo -u $HOME_USER -i
|
||||||
# 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.
|
||||||
@ -28,6 +32,7 @@ if [ "${HOME_USER-}" ]; then
|
|||||||
|
|
||||||
# sudo sed -i "/vscode/d" /etc/sudoers.d/nopasswd
|
# sudo sed -i "/vscode/d" /etc/sudoers.d/nopasswd
|
||||||
# sudo cd /home/${HOME_USER}
|
# sudo cd /home/${HOME_USER}
|
||||||
|
sudo chown -R ${HOME_USER}:${HOME_USER} /home/${HOME_USER}
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -70,8 +75,14 @@ else
|
|||||||
echo "File extensions.json not found"
|
echo "File extensions.json not found"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -z "${VSCODE_TUNNEL_NAME}" ]]; then
|
# Allow users to have scripts run on container startup to prepare workspace.
|
||||||
sudo su - ${HOME_USER} -c "code tunnel --accept-server-license-terms"
|
# https://github.com/coder/code-server/issues/5177
|
||||||
else
|
if [ -d "${ENTRYPOINTD}" ]; then
|
||||||
sudo su - ${HOME_USER} -c "code tunnel --accept-server-license-terms --name ${VSCODE_TUNNEL_NAME}"
|
find "${ENTRYPOINTD}" -type f -executable -print -exec {} \;
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -z "${VSCODE_TUNNEL_NAME}" ]]; then
|
||||||
|
exec dumb-init sudo su - ${HOME_USER} -c "code tunnel --accept-server-license-terms $@"
|
||||||
|
else
|
||||||
|
exec dumb-init sudo su - ${HOME_USER} -c "code tunnel --accept-server-license-terms --name ${VSCODE_TUNNEL_NAME} $@"
|
||||||
fi
|
fi
|
||||||
|
@ -1 +1 @@
|
|||||||
2.0.11
|
2.0.15
|
Reference in New Issue
Block a user