mirror of
https://github.com/aleleba/aleleba-vscode-dockerfile-configuration.git
synced 2025-06-19 12:28:15 -06:00
Compare commits
8 Commits
Author | SHA1 | Date | |
---|---|---|---|
9bac2433a6 | |||
d8a291c82d | |||
3cee54d519 | |||
f68ef82de3 | |||
47d6a61a28 | |||
b5cbdca7ef | |||
68bdbd4c61 | |||
a164ccadff |
14
Dockerfile
14
Dockerfile
@ -12,6 +12,16 @@ 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 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
|
||||||
|
|
||||||
#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
|
||||||
@ -34,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"]
|
@ -1,11 +1,31 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
set -eu
|
||||||
|
|
||||||
if [[ -z "${HOME_USER}" ]]; then
|
if [[ -z "${HOME_USER}" ]]; then
|
||||||
HOME_USER="vscode"
|
HOME_USER="vscode"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
addgroup nonroot
|
#addgroup nonroot
|
||||||
adduser --disabled-password --gecos "" ${HOME_USER}
|
#adduser --disabled-password --gecos "" ${HOME_USER}
|
||||||
echo "${HOME_USER} ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
|
#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
|
#Creating extensions folder
|
||||||
sudo mkdir /home/${HOME_USER}/.config/Code
|
sudo mkdir /home/${HOME_USER}/.config/Code
|
||||||
|
@ -1 +1 @@
|
|||||||
1.1.4
|
2.0.5
|
Reference in New Issue
Block a user