updated build/setup to match scwrypts v3

This commit is contained in:
2023-06-27 18:30:02 -06:00
parent 1a64551465
commit dff8211b9d
11 changed files with 111 additions and 81 deletions

View File

@ -20,6 +20,8 @@ RUN : \
openssh \
pciutils \
postgresql \
py3-virtualenv \
py3-nodeenv \
redis \
ripgrep \
sed \
@ -31,21 +33,26 @@ RUN : \
zsh \
&& apk add --update --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community/ \
helm \
&& apk add --update --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing/ \
kubectl \
&& apk add --update --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing/ \
&& mkdir -p /root/.wryn \
;
COPY . /root/.wryn
RUN : \
&& echo "#!/bin/zsh" > /bin/hostnamectl && echo "echo container" > /bin/hostnamectl && chmod +x /bin/hostnamectl \
&& echo "#!/bin/zsh" > /bin/scwrypts && echo '/root/.wryn/zsh/plugins/scwrypts/scwrypts $@' >> /bin/scwrypts && chmod +x /bin/scwrypts \
&& mkdir /root/.wryn/bin/container \
&& sed -i 's|/bin/ash|/bin/zsh|g' /etc/passwd \
&& /bin/zsh -c '/root/.wryn/setup/run --no-fluff --ci --force-root' \
&& echo 'hostnamectl() { echo docker; }' > $HOME/.config/wryn/env.zsh \
&& echo 'source /root/.wryn/config/dotwryn.env.zsh' >> $HOME/.config/wryn/env.zsh \
&& echo "WELCOME() {}" >> $HOME/.config/wryn/env.zsh \
&& echo "PS1_INDICATOR_SYMBOL=''" >> $HOME/.config/wryn/env.zsh \
&& echo "PS1_USER='root@debugger'" >> $HOME/.config/wryn/env.zsh \
&& echo 'source /root/.wryn/config/dotwryn.env.zsh' > /root/.config/wryn/env.zsh \
&& echo "WELCOME() {}" >> /root/.config/wryn/env.zsh \
&& echo "PS1_INDICATOR_SYMBOL=''" >> /root/.config/wryn/env.zsh \
&& echo "PS1_USER=\"root@\$(ip a | grep inet | grep -v '127\\.0\\.0\.1' | sed 's|/| |g' | awk '{print \$2;}')\"" >> /root/.config/wryn/env.zsh \
&& echo "source /root/.wryn/zsh/plugins/scwrypts/scwrypts.plugin.zsh" >> /root/.config/wryn/env.zsh \
&& rm /root/dotwryn-install.log \
&& scwrypts --name scwrypts/virtualenv/update-all --group scwrypts --type zsh \
;
ENTRYPOINT ["/root/.wryn/.docker/entrypoint"]

View File

@ -1,18 +1,13 @@
#!/bin/zsh
#####################################################################
echo -e "\\033[1;31m=====================================================================\\033[0m
\\033[1;32mWelcome to Debugger!\\033[0m
You are now entering a root-privileged container with a variety of
powerful tools. Be sure to exercise appropriate caution for your
current use-case / environment!
\\033[1;32mGLHF <3\\033[0m
\\033[1;31m=====================================================================\\033[0m"
#####################################################################
zsh -l
source /root/.wryn/.docker/session/start-background
[ -t 0 ] && tmux a -t $SESSION || echo -e "\\033[1;32m
REMINDER: connect by executing 'tmux a -t $SESSION'
\\033[0m"
until ! tmux list-sessions 2>/dev/null | awk '{print $1;}' | grep -q "${SESSION}:"; do sleep 1; done
#####################################################################
echo -e "\\033[1;31m=====================================================================\\033[0m
\\033[1;32mExiting Debugger; see you next time!\\033[0m

15
.docker/session/show-warning Executable file
View File

@ -0,0 +1,15 @@
#!/bin/zsh
echo -e "\\033[1;31m=====================================================================\\033[0m
\\033[1;32mWelcome to Debugger!\\033[0m
You are now entering a root-privileged container with a variety of
powerful tools. Be sure to exercise appropriate caution for your
current use-case / environment!
\\033[1;32mGLHF <3\\033[0m
\\033[1;31m=====================================================================\\033[0m"
echo 'press Enter to continue'
read

View File

@ -0,0 +1,13 @@
#!/bin/zsh
SESSION=debugger
tmux ls | grep -q "^$SESSION" && exit 0
#####################################################################
cd
tmux new -d -s $SESSION \
;
tmux new-window -t $SESSION -n \
'WARNING' /root/.wryn/.docker/session/show-warning \
;