Compare commits

...

10 Commits

3 changed files with 29 additions and 16 deletions

View File

@ -13,7 +13,7 @@ RUN sudo apt-get install -y wget
RUN sudo apt-get install -y jq RUN sudo apt-get install -y jq
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
RUN ARCH="$(dpkg --print-architecture)" \ 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 - \ && 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 - \
@ -22,10 +22,6 @@ RUN ARCH="$(dpkg --print-architecture)" \
&& mkdir -p /etc/fixuid \ && mkdir -p /etc/fixuid \
&& printf "user: vscode\ngroup: vscode\n" > /etc/fixuid/config.yml && printf "user: vscode\ngroup: vscode\n" > /etc/fixuid/config.yml
USER 1000
ENV USER=vscode
WORKDIR /home/vscode
#Instalando devtunnel #Instalando devtunnel
#Comandos que no se deben olvidar correr al crear el devtunnel #Comandos que no se deben olvidar correr al crear el devtunnel
#devtunnel user login -g -d #devtunnel user login -g -d
@ -48,4 +44,8 @@ RUN sudo sysctl -w fs.inotify.max_user_watches=524288
ADD ./entrypoint.sh /usr/bin/entrypoint.sh ADD ./entrypoint.sh /usr/bin/entrypoint.sh
RUN sudo chmod +x /usr/bin/entrypoint.sh RUN sudo chmod +x /usr/bin/entrypoint.sh
USER 1000
ENV USER=vscode
WORKDIR /home/vscode
ENTRYPOINT ["/usr/bin/entrypoint.sh"] ENTRYPOINT ["/usr/bin/entrypoint.sh"]

View File

@ -13,26 +13,39 @@ fi
# Otherwise the current container UID may not exist in the passwd database. # Otherwise the current container UID may not exist in the passwd database.
eval "$(fixuid -q)" eval "$(fixuid -q)"
if [ "${DOCKER_USER-}" ]; then if [ "${HOME_USER-}" ]; then
USER="$DOCKER_USER" USER="$HOME_USER"
if [ "$DOCKER_USER" != "$(whoami)" ]; then if [ "$HOME_USER" != "$(whoami)" ]; then
echo "$DOCKER_USER ALL=(ALL) NOPASSWD:ALL" | sudo tee -a /etc/sudoers.d/nopasswd > /dev/null if ! id -u $HOME_USER > /dev/null 2>&1; 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
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.
sudo usermod --login "$DOCKER_USER" vscode # sudo usermod --login "$HOME_USER" vscode
sudo groupmod -n "$DOCKER_USER" vscode # sudo groupmod -n "$HOME_USER" vscode
sudo sed -i "/vscode/d" /etc/sudoers.d/nopasswd # sudo sed -i "/vscode/d" /etc/sudoers.d/nopasswd
# sudo cd /home/${HOME_USER}
fi fi
fi fi
#Creating extensions folder #Creating extensions folder
sudo mkdir /home/${HOME_USER}/.config/Code if [ ! -d "/home/${HOME_USER}/.config/Code" ]; then
sudo mkdir -p /home/${HOME_USER}/.config/Code
fi
sudo chmod -R a+rwX /home/${HOME_USER}/.config/Code sudo chmod -R a+rwX /home/${HOME_USER}/.config/Code
sudo mkdir /home/${HOME_USER}/.vscode-server
if [ ! -d "/home/${HOME_USER}/.vscode-server" ]; then
sudo mkdir -p /home/${HOME_USER}/.vscode-server
fi
sudo chmod -R a+rwX /home/${HOME_USER}/.vscode-server sudo chmod -R a+rwX /home/${HOME_USER}/.vscode-server
sudo mkdir /home/${HOME_USER}/.vscode-server-insiders
if [ ! -d "/home/${HOME_USER}/.vscode-server-insiders" ]; then
sudo mkdir -p /home/${HOME_USER}/.vscode-server-insiders
fi
sudo chmod -R a+rwX /home/${HOME_USER}/.vscode-server-insiders sudo chmod -R a+rwX /home/${HOME_USER}/.vscode-server-insiders
# Check if the data.json file exists # Check if the data.json file exists

View File

@ -1 +1 @@
2.0.1 2.0.11