Compare commits

...

8 Commits

3 changed files with 34 additions and 18 deletions

View File

@ -12,6 +12,9 @@ RUN sudo apt-get install -y wget
#Instalando jq #Instalando jq
RUN sudo apt-get install -y jq RUN sudo apt-get install -y jq
RUN sudo apt-get update
RUN sudo apt-get install dumb-init
RUN adduser --gecos '' --disabled-password vscode \ RUN adduser --gecos '' --disabled-password vscode \
&& echo "vscode ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/nopasswd && echo "vscode ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/nopasswd

View File

@ -16,21 +16,34 @@ 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
if ! id -u $HOME_USER > /dev/null 2>&1; then # if ! id -u $HOME_USER > /dev/null 2>&1; then
sudo adduser --disabled-password --gecos "" ${HOME_USER} # Create a user with the same UID as the host user.
sudo echo "$HOME_USER ALL=(ALL) NOPASSWD:ALL" | sudo tee -a /etc/sudoers.d/nopasswd > /dev/null # sudo adduser --disabled-password --gecos "" ${HOME_USER}
fi # sudo echo "$HOME_USER ALL=(ALL) NOPASSWD:ALL" | sudo tee -a /etc/sudoers.d/nopasswd > /dev/null
# Copy environment variables from vscode user to HOME_USER
env | grep -v 'HOME_USER' | while read -r line; do # Set the default shell to bash for VS Code Remote - Containers
sudo su - ${HOME_USER} -c "echo 'export $line' >> ~/.bashrc" # sudo usermod --login "$HOME_USER" vscode
done # sudo groupmod -n "$HOME_USER" vscode
sudo -u $HOME_USER -i # sudo sed -i "/vscode/d" /etc/sudoers.d/nopasswd
# 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. # Crear el nuevo directorio home si no existe
# sudo usermod --login "$HOME_USER" vscode # if [ -d "/home/${HOME_USER}" ]; then
# sudo groupmod -n "$HOME_USER" vscode # Si existe, hacer una copia de seguridad de los archivos existentes
# sudo mv /home/${HOME_USER} /home/${HOME_USER}_backup
# fi
# Cambiar el directorio home del usuario vscode a /home/${HOME_USER}
# sudo usermod -d /home/${HOME_USER} -m vscode
# sudo usermod -d /home/${HOME_USER} vscode
# su - ${HOME_USER}
# 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 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} sudo chown -R ${HOME_USER}:${HOME_USER} /home/${HOME_USER}
fi fi
@ -77,9 +90,9 @@ fi
# Allow users to have scripts run on container startup to prepare workspace. # Allow users to have scripts run on container startup to prepare workspace.
# https://github.com/coder/code-server/issues/5177 # https://github.com/coder/code-server/issues/5177
if [ -d "${ENTRYPOINTD}" ]; then #if [ -d "${ENTRYPOINTD}" ]; then
find "${ENTRYPOINTD}" -type f -executable -print -exec {} \; #find "${ENTRYPOINTD}" -type f -executable -print -exec {} \;
fi #fi
if [[ -z "${VSCODE_TUNNEL_NAME}" ]]; then if [[ -z "${VSCODE_TUNNEL_NAME}" ]]; then
exec dumb-init sudo su - ${HOME_USER} -c "code tunnel --accept-server-license-terms $@" exec dumb-init sudo su - ${HOME_USER} -c "code tunnel --accept-server-license-terms $@"

2
version.txt Normal file → Executable file
View File

@ -1 +1 @@
2.0.15 2.0.23