From d20985b7132c6ebe2af7085bd096723aa8c6f9ed Mon Sep 17 00:00:00 2001 From: maride Date: Fri, 4 May 2018 19:33:31 +0200 Subject: [PATCH] Setup texbox --- Dockerfile | 13 +++++++++++++ run.sh | 22 ++++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 Dockerfile create mode 100755 run.sh diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..4f9e8d9 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +FROM debian:stable + +RUN apt-get update +RUN apt-get install -y texlive-full + +RUN mkdir /tex +COPY run.sh /run.sh +RUN chmod +x /run.sh + +ENV TARGET= + +WORKDIR /tex +CMD /run.sh diff --git a/run.sh b/run.sh new file mode 100755 index 0000000..d5770a1 --- /dev/null +++ b/run.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +ECHOPREFIX=" => " +NULLPREFIX=" " + +echo "=> Hello, this is \033[31mtexbox\033[0m" + +if test "$(ls -A /tex)"; then + # Directory not empty - user mounted directory \o/ + if [ -z "$TARGET" ]; then + # target unset. + TARGET="*.tex" + fi + + # Build the PDF + texi2pdf $TARGET +else + # Directory is empty + echo "=> Please mount your directory to /tex" + echo " See you soon." +fi +