mirror of
https://github.com/aleleba/aleleba-vscode-dockerfile-configuration.git
synced 2025-06-18 11:58:12 -06:00
Compare commits
16 Commits
Author | SHA1 | Date | |
---|---|---|---|
f29f99181e | |||
8e9ef7bfa9 | |||
762ff44dc8 | |||
ac7a82f0ca | |||
9bac2433a6 | |||
d8a291c82d | |||
3cee54d519 | |||
f68ef82de3 | |||
47d6a61a28 | |||
b5cbdca7ef | |||
68bdbd4c61 | |||
a164ccadff | |||
d755728ed8 | |||
c17566fd5f | |||
f9351861bd | |||
1634a2a507 |
14
Dockerfile
14
Dockerfile
@ -12,6 +12,16 @@ 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
|
||||
|
||||
#Instalando devtunnel
|
||||
#Comandos que no se deben olvidar correr al crear el devtunnel
|
||||
#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
|
||||
RUN sudo chmod +x /usr/bin/entrypoint.sh
|
||||
|
||||
USER 1000
|
||||
ENV USER=vscode
|
||||
WORKDIR /home/vscode
|
||||
|
||||
ENTRYPOINT ["/usr/bin/entrypoint.sh"]
|
@ -1,11 +1,34 @@
|
||||
#!/bin/bash
|
||||
set -eu
|
||||
|
||||
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
|
||||
#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 [ "${HOME_USER-}" ]; then
|
||||
USER="$HOME_USER"
|
||||
if [ "$HOME_USER" != "$(whoami)" ]; 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
|
||||
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 sed -i "/vscode/d" /etc/sudoers.d/nopasswd
|
||||
sudo cd /home/${HOME_USER}
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
#Creating extensions folder
|
||||
sudo mkdir /home/${HOME_USER}/.config/Code
|
||||
@ -21,7 +44,7 @@ if [ -f "/home/extensions.json" ]; then
|
||||
jsonExtensions=$(cat /home/extensions.json)
|
||||
|
||||
# Use jq to extract the extension parameter from the JSON array
|
||||
extensions=$(echo $jsonExtensions | jq -r '.[].extensionsGroup[].extensions[].uniqueIdentifier')
|
||||
extensions=$(echo $jsonExtensions | jq -r '.[].extensionsGroup.extensions[].uniqueIdentifier')
|
||||
|
||||
# Loop through the extensions and process each element
|
||||
for extension in $extensions; do
|
||||
|
@ -1 +1 @@
|
||||
1.1.0
|
||||
2.0.9
|
Reference in New Issue
Block a user