-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
77 lines (69 loc) · 2.33 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# Dockerfile
# docker build . -t pandoc_all
# WINDOWS: docker run -it --rm -v ${PWD}/md2pdfLib:/md2pdfLib -v ${PWD}/data:/data --name mypandoc -h mypandoc pandoc_all
# LINUX: docker run -it --rm -v $(pwd)/md2pdfLib:/md2pdfLib -v $(pwd)/data:/data --name mypandoc -h mypandoc pandoc_all
FROM ubuntu:24.04
ENV TZ="Europe/Berlin"
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && \
echo $TZ > /etc/timezone && \
apt-get update -y && \
apt-get upgrade -y && \
apt-get -y install sudo && \
apt-get install -y -o Acquire::Retries=20 \
--no-install-recommends \
lmodern \
imagemagick \
unzip \
python3-full \
pip \
ghostscript \
locales \
joe \
vim \
nano \
emacs \
curl \
wget \
ca-certificates \
texlive-full \
texlive-latex-recommended \
texlive-latex-extra \
texlive-fonts-recommended \
texlive-lang-german \
texlive-pstricks \
texlive-fonts-extra \
less && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# for styling our code snippets
RUN python3 -m venv md2pdf && \
. md2pdf/bin/activate && \
pip3 install Pygments
# install a specific Pandoc version for amd64 or arm64 platform
# i want to use it on my schlaptop and my himbeerkuchen (raspberrypi)
ARG TARGETARCH
RUN if [ "$TARGETARCH" = "amd64" ]; then \
curl -L https://github.com/jgm/pandoc/releases/download/3.6/pandoc-3.6-2-amd64.deb \
-o /tmp/pandoc.deb && \
dpkg -i /tmp/pandoc.deb && \
rm /tmp/pandoc.deb; \
elif [ "$TARGETARCH" = "arm64" ]; then \
curl -L https://github.com/jgm/pandoc/releases/download/3.6/pandoc-3.6-2-arm64.deb \
-o /tmp/pandoc.deb && \
dpkg -i /tmp/pandoc.deb && \
rm /tmp/pandoc.deb; \
fi
# install fonts
ADD Roboto.zip /usr/local/share/texmf
# make outr custom themes globally available
RUN mkdir -p /root/texmf/tex/latex/commonstuff/
ADD md2pdfLib/presentation/template/latex/awesome-beamer /root/texmf/tex/latex/commonstuff/
ADD md2pdfLib/presentation/template/latex/smile /root/texmf/tex/latex/commonstuff/
RUN texhash
# RUN mktexlsr
# neccessary file for generating pdf (scripts, templates, ... etc.)
VOLUME ["/md2pdfLib"]
# connect to your local directory with *.md files
VOLUME ["/data"]
# Activate the virtual environment and start the application
ENTRYPOINT ["sh", "-c", ". md2pdf/bin/activate && exec /bin/bash"]