This commit is contained in:
thek4n 2024-11-18 21:22:39 +03:00
parent 855009b507
commit 31c636c147
3 changed files with 30 additions and 4 deletions

View File

@ -19,4 +19,5 @@ psql:.psqlrc
docker:.docker/cli-plugins
ipython:.ipython/profile_default/ipython_config.py
gdb:.config/gdb
sandbox:
all:%less %t %tmux %zsh %nvim %git"

View File

@ -0,0 +1,28 @@
#!/bin/sh
sudo useradd -M -s /opt/bin/sandbox sandbox
sudo usermod -aG docker sandbox
echo "/opt/bin/sandbox" | sudo tee -a /etc/shells # for pam
set -eu
cd "$(mktemp -d)"
cat > Dockerfile << EOF
FROM debian:bookworm-slim
RUN apt update -y && apt upgrade -y && apt install -y neovim zsh git wget && \
useradd -Um -s /bin/zsh sandbox
WORKDIR /home/sandbox
USER sandbox
RUN git clone https://github.com/thek4n/dotfiles && cd dotfiles && ./install zsh && zsh -i
ENTRYPOINT ["zsh"]
EOF
docker build -t sandbox .

View File

@ -1,5 +1,2 @@
#!/bin/sh
# useradd -md /home/sandbox -s $0 sandbox
# usermod -aG docker sandbox
# echo "$0" | sudo tee -a /etc/shells # for pam
exec docker run --rm -it -v sandbox:/root -w /root --network none alpine
exec docker run --rm -it --network none sandbox