-
-
Notifications
You must be signed in to change notification settings - Fork 447
Expand file tree
/
Copy pathDockerfile.base
More file actions
56 lines (47 loc) · 1.7 KB
/
Dockerfile.base
File metadata and controls
56 lines (47 loc) · 1.7 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
#------------------------------------------------
# Common modules
#------------------------------------------------
FROM ghcr.io/astral-sh/uv:python3.14-trixie-slim AS common
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
UV_COMPILE_BYTECODE=1 \
UV_LINK_MODE=copy \
QTWEBENGINE_DISABLE_SANDBOX=1 \
QT_QPA_PLATFORM=offscreen \
QTWEBENGINE_CHROMIUM_FLAGS="--no-sandbox --disable-gpu --disable-software-rasterizer"
RUN apt-get update -yq && \
apt-get install -yq --no-install-recommends \
ca-certificates \
libegl1 \
libopengl0 \
libglx0 \
libnss3 \
libasound2 \
libfontconfig \
libxkbcommon0 \
&& rm -rf /var/lib/apt/lists/*
#------------------------------------------------
# Install Calibre
#------------------------------------------------
FROM common AS calibre
RUN apt-get update -yq && \
apt-get install -yq --no-install-recommends \
wget \
libxcb-cursor0 \
xdg-utils \
xz-utils \
&& rm -rf /var/lib/apt/lists/*
RUN wget -nv -O- https://download.calibre-ebook.com/linux-installer.sh \
| sh /dev/stdin install_dir=/opt/calibre isolated=y
# Only ebook-convert is used at runtime; strip everything else
RUN rm -rf /opt/calibre/resources/content-server \
/opt/calibre/resources/mathjax \
&& find /opt/calibre/resources/localization -name '*.mo' ! -name 'en*' -delete 2>/dev/null; \
find /opt/calibre -name '*.so' -exec strip --strip-unneeded {} + 2>/dev/null; \
true
#------------------------------------------------
# Base runtime image
#------------------------------------------------
FROM common
COPY --from=calibre /opt/calibre /opt/calibre
RUN ln -s /opt/calibre/calibre/ebook-convert /usr/local/bin/ebook-convert