mirror of
https://github.com/aleleba/aleleba-vscode-dockerfile-configuration.git
synced 2025-06-19 12:28:15 -06:00
Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
680e3810b6
|
|||
6519cc3ef9
|
|||
c27e148488
|
|||
cd8b5c19e1
|
|||
a6e4296f25
|
|||
08cf40624d
|
@ -47,4 +47,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,6 +1,12 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
|
# Check if we are root
|
||||||
|
if [ "$(id -u)" != "0" ]; then
|
||||||
|
echo "This script must be run as root" 1>&2
|
||||||
|
exec sudo /usr/bin/entrypoint.sh
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ -z "${HOME_USER-}" ]]; then
|
if [[ -z "${HOME_USER-}" ]]; then
|
||||||
HOME_USER="vscode"
|
HOME_USER="vscode"
|
||||||
fi
|
fi
|
||||||
@ -11,7 +17,7 @@ eval "$(fixuid -q)"
|
|||||||
|
|
||||||
if [ "${HOME_USER-}" ]; then
|
if [ "${HOME_USER-}" ]; then
|
||||||
USER="$HOME_USER"
|
USER="$HOME_USER"
|
||||||
if [ "$HOME_USER" != "$(whoami)" ]; then
|
if [[ "${HOME_USER-}" != "vscode" ]]; then
|
||||||
if ! id -u $HOME_USER > /dev/null 2>&1; then
|
if ! id -u $HOME_USER > /dev/null 2>&1; then
|
||||||
sudo adduser --disabled-password --gecos "" ${HOME_USER}
|
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 echo "$HOME_USER ALL=(ALL) NOPASSWD:ALL" | sudo tee -a /etc/sudoers.d/nopasswd > /dev/null
|
||||||
|
@ -1 +1 @@
|
|||||||
2.0.51
|
2.0.57
|
Reference in New Issue
Block a user