forked from rrthomas/hpmor
-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathDockerfile
More file actions
65 lines (52 loc) · 1.48 KB
/
Dockerfile
File metadata and controls
65 lines (52 loc) · 1.48 KB
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
# 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 packages and cleanup afterwards
RUN apt-get update && apt-get dist-upgrade -y && \
apt-get install -y \
calibre \
ghostscript \
git \
imagemagick \
latexmk \
pandoc \
python3 \
python3-lxml \
texlive-extra-utils \
texlive-lang-german \
texlive-lang-greek \
texlive-xetex && \
apt-get clean autoclean && \
apt-get autoremove --yes && \
rm -rf /var/lib/{apt,dpkg,cache,log}/ && \
useradd -m -s /bin/bash app
# switch to non-root user
USER app
# mount host directory as volume
VOLUME /app
# set working directory
WORKDIR /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
# delete all docker containers and cache
# docker system prune -f