From 1d0e72d4d41c13964035d3e320c26a8dfbae326f Mon Sep 17 00:00:00 2001 From: "Michal J. Gajda" Date: Tue, 28 Feb 2023 19:54:30 +0100 Subject: [PATCH 1/5] Add pdflatex to base image. --- Dockerfile | 5 +++++ test.sh | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 3d5dafe..eaaa635 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,9 @@ FROM fpco/stack-build:lts-18.12 +ENV DEBCONF=noninteractive +ENV TZ=Europe/Warsaw +RUN --mount=type=cache,target=/var/cache/apt \ + apt-get update && \ + apt-get install -y texlive-xetex texlive-latex-base RUN mkdir /opt/build COPY . /opt/build WORKDIR /opt/build diff --git a/test.sh b/test.sh index 0729458..623ee6b 100755 --- a/test.sh +++ b/test.sh @@ -30,7 +30,7 @@ build() { cat out.md } -build +build || exit 1 if [ "$1" == "--watch" ]; then while inotifywait -e modify,move src/*.hs app/*.hs src/*/*.hs test/*.md; do build ${NAME}; From 01ba4a203c48a1195ad94e22f77d05153ffba9d8 Mon Sep 17 00:00:00 2001 From: "Michal J. Gajda" Date: Tue, 28 Feb 2023 20:00:38 +0100 Subject: [PATCH 2/5] Add missing timezone data. --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index eaaa635..e565587 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,10 @@ FROM fpco/stack-build:lts-18.12 ENV DEBCONF=noninteractive ENV TZ=Europe/Warsaw +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone RUN --mount=type=cache,target=/var/cache/apt \ apt-get update && \ - apt-get install -y texlive-xetex texlive-latex-base + apt-get install -y texlive-xetex texlive-latex-base tzdata < /dev/null RUN mkdir /opt/build COPY . /opt/build WORKDIR /opt/build From 51a4abcdd0323febe5d39778ab078235ad2bab81 Mon Sep 17 00:00:00 2001 From: "Michal J. Gajda" Date: Tue, 28 Feb 2023 20:25:47 +0100 Subject: [PATCH 3/5] Disable docker. --- stack.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stack.yaml b/stack.yaml index 0073e98..62dbbba 100644 --- a/stack.yaml +++ b/stack.yaml @@ -14,4 +14,4 @@ extra-deps: - roman-numerals-0.5.1.5@sha256:819d04d9d442b24629dd058f6f0b02bd78e9f9ae99538bc44ca448f1cb2b7b01,1208 docker: - registry-login: true + enable: false From 61d9c3cdeb5ed214c59d596ffb8a608d10bf6311 Mon Sep 17 00:00:00 2001 From: "Michal J. Gajda" Date: Tue, 28 Feb 2023 20:52:39 +0100 Subject: [PATCH 4/5] Add texlive-science. --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index e565587..064cf9e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,7 @@ ENV TZ=Europe/Warsaw RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone RUN --mount=type=cache,target=/var/cache/apt \ apt-get update && \ - apt-get install -y texlive-xetex texlive-latex-base tzdata < /dev/null + apt-get install -y texlive-xetex texlive-latex-base texlive-science tzdata < /dev/null RUN mkdir /opt/build COPY . /opt/build WORKDIR /opt/build From 4b529aded1a8da9bfe77ff30ae9f25c0988e3602 Mon Sep 17 00:00:00 2001 From: "Michal J. Gajda" Date: Thu, 2 Mar 2023 03:36:46 +0100 Subject: [PATCH 5/5] Add --mount option for apt and stack cache. --- Dockerfile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 064cf9e..3df1d98 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,7 +8,8 @@ RUN --mount=type=cache,target=/var/cache/apt \ RUN mkdir /opt/build COPY . /opt/build WORKDIR /opt/build -RUN stack install --no-docker --system-ghc -RUN stack install --no-docker --system-ghc pandoc -RUN stack install --no-docker --system-ghc pandoc-plot +RUN --mount=type=cache,target=/root/.stack \ + stack install --no-docker --system-ghc && \ + stack install --no-docker --system-ghc pandoc && \ + stack install --no-docker --system-ghc pandoc-plot RUN ./test.sh