add Debian variant

This commit is contained in:
Nils 2021-06-23 21:39:56 +02:00
parent 3700652e51
commit f25dab2d79
Signed by: byreqz
GPG Key ID: 396A62D7D436749E
2 changed files with 34 additions and 0 deletions

11
Debian/Dockerfile Normal file
View File

@ -0,0 +1,11 @@
FROM debian:sid
RUN apt-get update
RUN apt-get install -y curl jq tmux
RUN curl -s https://api.github.com/repos/yudai/gotty/releases/latest | jq -r '.assets[].browser_download_url' | grep "gotty_linux_amd64.tar.gz" | xargs curl -L -o gotty_linux_amd64.tar.gz
RUN tar xvfz gotty_linux_amd64.tar.gz
ENV TERM=xterm
COPY run-deb.sh ./run.sh
RUN chmod +x ./run.sh
ENTRYPOINT ["/run.sh"]

23
Debian/run-deb.sh Normal file
View File

@ -0,0 +1,23 @@
#!/bin/bash
if [ -z "$port" ];then
port=8080
fi
if [ -n "$userpass" ];then
creds="-c "$userpass""
fi
if [ -z "$title" ];then
title=gotty
fi
if [ -n "$pkgs" ];then
apt-get update
apt-get install $pkgs
fi
if [ -z "$command" ];then
apt-get update
apt-get install figlet
command="curl -s https://raw.githubusercontent.com/dylanaraps/pfetch/master/pfetch | bash && figlet no command set && read swag"
fi
/gotty -p "$port" $creds --title-format "$title" tmux new-session -A -s "$title" "$command"