Compare commits

..

2 Commits
1.1.6 ... 2.0.1

3 changed files with 35 additions and 20 deletions

View File

@ -12,6 +12,20 @@ RUN sudo apt-get install -y wget
#Instalando jq
RUN sudo apt-get install -y jq
RUN adduser --gecos '' --disabled-password vscode \
&& echo "vscode ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/nopasswd
RUN ARCH="$(dpkg --print-architecture)" \
&& curl -fsSL "https://github.com/boxboat/fixuid/releases/download/v0.6.0/fixuid-0.6.0-linux-$ARCH.tar.gz" | tar -C /usr/local/bin -xzf - \
&& chown root:root /usr/local/bin/fixuid \
&& chmod 4755 /usr/local/bin/fixuid \
&& mkdir -p /etc/fixuid \
&& printf "user: vscode\ngroup: vscode\n" > /etc/fixuid/config.yml
USER 1000
ENV USER=vscode
WORKDIR /home/vscode
#Instalando devtunnel
#Comandos que no se deben olvidar correr al crear el devtunnel
#devtunnel user login -g -d

View File

@ -1,31 +1,32 @@
#!/bin/bash
if [[ -z "${HOME_USER}" ]]; then
HOME_USER="vscode"
fi
set -eu
# We do this first to ensure sudo works below when renaming the user.
# Otherwise the current container UID may not exist in the passwd database.
eval "$(fixuid -q)"
if [ "${HOME_USER-}" ]; then
USER="$HOME_USER"
if [ "$HOME_USER" != "$(whoami)" ]; then
echo "$HOME_USER ALL=(ALL) NOPASSWD:ALL" | sudo tee -a /etc/sudoers.d/nopasswd > /dev/null
# 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 "$HOME_USER" $HOME_USER
sudo groupmod -n "$HOME_USER" $HOME_USER
sudo sed -i "/$HOME_USER/d" /etc/sudoers.d/nopasswd
fi
if [[ -z "${HOME_USER}" ]]; then
HOME_USER="vscode"
fi
#addgroup nonroot
#adduser --disabled-password --gecos "" ${HOME_USER}
#echo "${HOME_USER} ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
# We do this first to ensure sudo works below when renaming the user.
# 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
# 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 sed -i "/vscode/d" /etc/sudoers.d/nopasswd
fi
fi
#Creating extensions folder
sudo mkdir /home/${HOME_USER}/.config/Code
sudo chmod -R a+rwX /home/${HOME_USER}/.config/Code

View File

@ -1 +1 @@
1.1.6
2.0.1