latest, seems to sort of work

This commit is contained in:
Jeffrey Paul 2019-08-04 19:02:42 -07:00
parent b8d90f2f8f
commit a1485030e8
3 changed files with 31 additions and 9 deletions

View File

@ -11,4 +11,9 @@ RUN bash /tmp/run.sh && rm /tmp/run.sh
RUN rm -f /etc/service/sshd/down
#cleanup
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN apt-get clean && \
rm -rf \
/var/lib/apt/lists/* \
/tmp/* \
/var/tmp/* \
/etc/ssh/ssh_host_*_key

View File

@ -4,9 +4,4 @@ BRANCH := $(shell git branch | sed -n -e 's/^\* \(.*\)/\1/p')
default: build
build:
script -q ./build.log docker build --no-cache -t sneak/sandbox .
docker tag sneak/sandbox sneak/sandbox:$(YYYYMMDD)
push:
docker push sneak/sandbox
docker push sneak/sandbox:$(YYYYMMDD)
script -q ./build.log docker build --no-cache -t sneak/sandbox:$(YYYYMMDD) .

26
run.sh
View File

@ -128,10 +128,26 @@ apt update
apt install -y neovim
mkdir -p /etc/bashrc.d
cat >> /etc/skel/.bashrc <<'EOF'
mkdir -p /etc/profile.d
cat >> /etc/bash.bashrc <<'EOF'
if ! shopt -oq posix; then
if [ -f /usr/share/bash-completion/bash_completion ]; then
. /usr/share/bash-completion/bash_completion
elif [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
fi
for FN in /etc/bashrc.d/*.sh; do
source "$FN"
done
if ! shopt -oq posix; then
for FN in /etc/profile.d/*.sh; do
source "$FN"
done
fi
EOF
################################################################################
@ -141,7 +157,9 @@ EOF
export NVM_DIR='/usr/local/nvm'
mkdir -p "$NVM_DIR"
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash
echo 'source /usr/local/nvm/nvm.sh' > /etc/bashrc.d/100.nvm.sh
cat > /etc/bashrc.d/100.nvm.sh <<'EOF'
source /usr/local/nvm/nvm.sh
EOF
source /etc/bashrc.d/100.nvm.sh
nvm install node
@ -210,6 +228,10 @@ for PKG in $PIP_PKGS; do
pip3 install $PKG
done
################################################################################
## add working user and add to sudo nopassword
################################################################################
groupadd -g 1000 $USERNAME
useradd -u 1000 -g 1000 -s /bin/bash $USERNAME
usermod -p '*' $USERNAME
echo "$USERNAME ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers