mirror of
https://github.com/aleleba/aleleba-vscode-dockerfile-configuration.git
synced 2025-06-19 04:18:11 -06:00
Compare commits
14 Commits
Author | SHA1 | Date | |
---|---|---|---|
2ab5fcffc7
|
|||
c1acddcc6e
|
|||
a9b021cebe
|
|||
fd7e35cf34
|
|||
f929aaac63
|
|||
c1affb8781
|
|||
dfeddf9688
|
|||
fe2a226190
|
|||
a983adf4ad
|
|||
374d13fe6c
|
|||
d4391139b2
|
|||
13571867ca
|
|||
52b9e7a411
|
|||
04e26f2afc
|
@ -20,10 +20,21 @@ if [ "${HOME_USER-}" ]; 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
|
||||
fi
|
||||
|
||||
# Check if .bashrc file exists
|
||||
if [ ! -f "/home/${HOME_USER}/.bashrc" ]; then
|
||||
# If not, create it
|
||||
sudo touch /home/${HOME_USER}/.bashrc
|
||||
fi
|
||||
|
||||
# Change the owner of the .bashrc file to HOME_USER
|
||||
sudo chown ${HOME_USER} /home/${HOME_USER}/.bashrc
|
||||
|
||||
# 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
|
||||
# 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.
|
||||
@ -75,14 +86,8 @@ else
|
||||
echo "File extensions.json not found"
|
||||
fi
|
||||
|
||||
# Allow users to have scripts run on container startup to prepare workspace.
|
||||
# https://github.com/coder/code-server/issues/5177
|
||||
if [ -d "${ENTRYPOINTD}" ]; then
|
||||
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 $@"
|
||||
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} $@"
|
||||
sudo su - ${HOME_USER} -c "code tunnel --accept-server-license-terms --name ${VSCODE_TUNNEL_NAME}"
|
||||
fi
|
||||
|
2
version.txt
Normal file → Executable file
2
version.txt
Normal file → Executable file
@ -1 +1 @@
|
||||
2.0.16
|
||||
2.0.30
|
Reference in New Issue
Block a user