forked from rrthomas/hpmor
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Dockerfile
50 lines (36 loc) · 1.38 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
# syntax=docker/dockerfile:1
# base image
FROM ubuntu:24.04
# set timezone
ENV TZ=Europe/Berlin
# prevent keyboard input requests in apt install
ENV DEBIAN_FRONTEND=noninteractive
# install core packages
RUN apt-get update && apt-get dist-upgrade -y && apt-get install -y python3 git
# for pdf, copied from scripts/install_requirements_pdf.sh
# for ebook, copied from scripts/install_requirements_ebook.sh
RUN apt-get install -y texlive-xetex texlive-lang-greek texlive-lang-german latexmk texlive-extra-utils pandoc calibre imagemagick ghostscript
# cleanup apt
RUN apt-get clean autoclean && apt-get autoremove --yes && rm -rf /var/lib/{apt,dpkg,cache,log}/
# set working directory
WORKDIR /app
# mount host directory as volume
VOLUME /app
# default command: build 1-vol pdf and all ebook formats
# CMD latexmk hpmor ; ./scripts/make_ebooks.sh
# 1. preparation
# 1.1 build/update image from Dockerfile
# docker build -t hpmor .
# 1.2 create container that mounts current working dir to /app
# docker run --name hpmor-de -it --mount type=bind,src="$(pwd)",dst=/app hpmor bash
# exit
# note: in Windows you need to replace "$(pwd)" by "%cd%" for the following commands
# 2. use container
# docker start -ai hpmor-de
# latexmk hpmor ; ./scripts/make_ebooks.sh
# exit
# 3. optionally: cleanup/delete hpmor from docker
# delete container
# docker rm hpmor-de
# delete image
# docker rmi hpmor