Compare commits

..

6 Commits

3 changed files with 16 additions and 9 deletions

View File

@ -47,8 +47,4 @@ 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"]

View File

@ -33,20 +33,31 @@ if [ "${HOME_USER-}" ]; then
sudo su - ${HOME_USER} -c "echo 'export $line' >> ~/.bashrc"
done
# Copy the HOME variable from vscode user to HOME_USER
sudo su - ${HOME_USER} -c "echo 'export HOME=\"/home/\${HOME_USER}\"' >> ~/.bashrc"
# Copy the .bashrc file from vscode user to HOME_USER
sudo su - ${HOME_USER} -c "cat /home/vscode/.bashrc >> ~/.bashrc"
# Creating .vscode folder if it doesn't exist
if [ ! -d "/home/${HOME_USER}/.vscode" ]; then
sudo mkdir -p /home/${HOME_USER}/.vscode
fi
# Changing the property of the directory /home/${HOME_USER}/.vscode
sudo chown -R ${HOME_USER}: /home/${HOME_USER}/.vscode
# Changing the HOME_USER in the .bashrc file
sudo su - ${HOME_USER} -c 'sudo sed -i "s|/home/vscode|/home/${HOME_USER}|g" ~/.bashrc'
sudo su - ${HOME_USER} -c "sudo sed -i \"s|/home/vscode|/home/${HOME_USER}|g\" ~/.bashrc"
# Switch to the user specified by $HOME_USER and start an interactive shell session.
sudo su -l ${HOME_USER}
# Delete the vscode user
if id "vscode" &>/dev/null; then
sudo chown -R vscode:vscode /home/vscode
sudo userdel -r vscode
fi
else
# Switch to the user specified by $HOME_USER and start an interactive shell session.
sudo su -l ${HOME_USER}
fi
fi

View File

@ -1 +1 @@
2.0.44
2.0.50