mirror of
https://github.com/aleleba/aleleba-vscode-dockerfile-configuration.git
synced 2025-06-19 12:28:15 -06:00
Compare commits
24 Commits
Author | SHA1 | Date | |
---|---|---|---|
fd7e35cf34
|
|||
f929aaac63
|
|||
c1affb8781
|
|||
dfeddf9688
|
|||
fe2a226190
|
|||
a983adf4ad
|
|||
374d13fe6c
|
|||
d4391139b2
|
|||
13571867ca
|
|||
52b9e7a411
|
|||
04e26f2afc
|
|||
dddaf129f4
|
|||
6525dc4c7e
|
|||
b3609b3d0b
|
|||
dd283a2c5f
|
|||
18fe10675c
|
|||
aabc21eac2
|
|||
50708112ac
|
|||
f29f99181e | |||
8e9ef7bfa9 | |||
762ff44dc8 | |||
ac7a82f0ca | |||
9bac2433a6 | |||
d8a291c82d |
@ -12,7 +12,10 @@ RUN sudo apt-get install -y wget
|
||||
#Instalando jq
|
||||
RUN sudo apt-get install -y jq
|
||||
|
||||
RUN adduser --uid 1001 --gecos '' --disabled-password vscode \
|
||||
RUN sudo apt-get update
|
||||
RUN sudo apt-get install dumb-init
|
||||
|
||||
RUN adduser --gecos '' --disabled-password vscode \
|
||||
&& echo "vscode ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/nopasswd
|
||||
|
||||
RUN ARCH="$(dpkg --print-architecture)" \
|
||||
|
19
entrypoint.sh
Normal file → Executable file
19
entrypoint.sh
Normal file → Executable file
@ -13,19 +13,26 @@ fi
|
||||
# Otherwise the current container UID may not exist in the passwd database.
|
||||
eval "$(fixuid -q)"
|
||||
|
||||
echo "HOME_USER: ${HOME_USER}"
|
||||
echo "whoami: $(whoami)"
|
||||
|
||||
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
|
||||
sudo adduser --disabled-password --gecos "" ${HOME_USER}
|
||||
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
|
||||
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.
|
||||
sudo usermod --login "$HOME_USER" vscode
|
||||
sudo groupmod -n "$HOME_USER" vscode
|
||||
# sudo usermod --login "$HOME_USER" vscode
|
||||
# sudo groupmod -n "$HOME_USER" vscode
|
||||
|
||||
## Agregar binarios
|
||||
sudo sed -i "/vscode/d" /etc/sudoers.d/nopasswd
|
||||
sudo cd /home/${HOME_USER}
|
||||
fi
|
||||
fi
|
||||
|
||||
|
2
version.txt
Normal file → Executable file
2
version.txt
Normal file → Executable file
@ -1 +1 @@
|
||||
2.0.3
|
||||
2.0.27
|
Reference in New Issue
Block a user