sandbox
This commit is contained in:
parent
855009b507
commit
31c636c147
@ -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"
|
||||
28
install-hooks/sandbox/post-install
Executable file
28
install-hooks/sandbox/post-install
Executable 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 .
|
||||
@ -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
|
||||
Loading…
x
Reference in New Issue
Block a user