forked from wietsedv/docker-calibre-server
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
99 lines (85 loc) · 3.34 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
FROM debian:bookworm-slim AS base
ARG APT_HTTP_PROXY
RUN export DEBIAN_FRONTEND="noninteractive" && \
if [ -n "$APT_HTTP_PROXY" ]; then \
printf 'Acquire::http::Proxy "%s";\n' "${APT_HTTP_PROXY}" > /etc/apt/apt.conf.d/apt-proxy.conf; \
fi && \
apt-get update && \
apt-get upgrade -y && \
apt-get install -y --no-install-recommends \
curl \
ca-certificates && \
apt-get clean && \
rm -rf /tmp/* /var/tmp/* /var/lib/apt/lists/* /etc/apt/apt.conf.d/apt-proxy.conf
FROM --platform=${BUILDPLATFORM} debian:bookworm-slim AS download
ARG CALIBRE_RELEASE="7.24.0"
ARG TARGETPLATFORM
RUN export DEBIAN_FRONTEND="noninteractive" && \
if [ -n "$APT_HTTP_PROXY" ]; then \
printf 'Acquire::http::Proxy "%s";\n' "${APT_HTTP_PROXY}" > /etc/apt/apt.conf.d/apt-proxy.conf; \
fi && \
apt-get update && \
apt-get install -y --no-install-recommends \
xz-utils \
curl \
ca-certificates && \
apt-get clean && \
rm -rf /tmp/* /var/tmp/* /var/lib/apt/lists/* /etc/apt/apt.conf.d/apt-proxy.conf
RUN if [ "${TARGETPLATFORM}" = "linux/amd64" ]; then \
ARCH=x86_64; \
elif [ "${TARGETPLATFORM}" = "linux/arm64" ]; then \
ARCH=arm64; \
else \
echo "Unsupported target platform: ${TARGETPLATFORM}"; false; \
fi && \
URL="https://github.com/kovidgoyal/calibre/releases/download/v${CALIBRE_RELEASE}/calibre-${CALIBRE_RELEASE}-${ARCH}.txz" && \
echo "fetching $URL" && \
curl -o /tmp/calibre-tarball.txz -L "$URL" && \
mkdir -p /opt/calibre && \
tar xvf /tmp/calibre-tarball.txz -C /opt/calibre && \
rm -rf /tmp/*
FROM base AS runtime
LABEL name="Calibre Server"
LABEL maintainer="Robert Loomans <[email protected]>"
LABEL description="A minimal Calibre docker image that runs calibre-server"
LABEL url="https://github.com/rloomans/docker-calibre-server"
LABEL source="https://github.com/rloomans/docker-calibre-server.git"
LABEL org.opencontainers.image.title="Calibre Server"
LABEL org.opencontainers.image.authors="Robert Loomans <[email protected]>"
LABEL org.opencontainers.image.source="https://github.com/rloomans/docker-calibre-server"
LABEL org.opencontainers.image.description="A minimal Calibre docker image that runs calibre-server"
RUN export DEBIAN_FRONTEND="noninteractive" && \
if [ -n "$APT_HTTP_PROXY" ]; then \
printf 'Acquire::http::Proxy "%s";\n' "${APT_HTTP_PROXY}" > /etc/apt/apt.conf.d/apt-proxy.conf; \
fi && \
apt-get update && \
apt-get install -y --no-install-recommends \
ca-certificates \
hicolor-icon-theme \
iproute2 \
libasound2 \
libegl1 \
libdeflate0 \
libfontconfig \
libglx0 \
libnss3 \
libopengl0 \
libxcomposite1 \
libxkbcommon0 \
libxkbfile1 \
libxrandr2 \
libxrandr2 \
libxtst6 \
libxdamage1 \
xdg-utils && \
apt-get clean && \
rm -rf /tmp/* /var/tmp/* /var/lib/apt/lists/* /etc/apt/apt.conf.d/apt-proxy.conf
COPY --from=download /opt/calibre /opt/calibre
RUN ln -s /bin/true /usr/local/bin/xdg-desktop-menu && \
ln -s /bin/true /usr/local/bin/xdg-mime && \
/opt/calibre/calibre_postinstall --make-errors-fatal && \
mkdir /library && \
touch /library/metadata.db
COPY start-calibre-server.sh .
EXPOSE 8080
CMD [ "/start-calibre-server.sh" ]