-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathDockerfile
27 lines (20 loc) · 1.02 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
FROM alpine:3.17.2@sha256:69665d02cb32192e52e07644d76bc6f25abeb5410edc1c7a81a10ba3f0efb90a
LABEL maintainer "Koen Rouwhorst <[email protected]>"
# NOTE: Amazon killed KindleGen https://www.amazon.com/gp/feature.html?docId=1000765211
ENV KINDLEGEN_VERSION="2.9"
ENV KINDLEGEN_CHECKSUM="9828db5a2c8970d487ada2caa91a3b6403210d5d183a7e3849b1b206ff042296"
RUN apk add --no-cache ca-certificates curl tar
ENV HOME /home/kindlegen
RUN adduser -u 1001 -D kindlegen \
&& chown -R kindlegen:kindlegen $HOME
WORKDIR /tmp
RUN curl "https://raw.githubusercontent.com/koenrh/docker-kindlegen/master/kindlegen/kindlegen_linux_2.6_i386_v${KINDLEGEN_VERSION/\./_}.tar.gz" \
-o "kindlegen-$KINDLEGEN_VERSION.tar.gz" \
&& echo "$KINDLEGEN_CHECKSUM kindlegen-$KINDLEGEN_VERSION.tar.gz" | sha256sum -c - \
&& mkdir -p /app \
&& tar -xzf "kindlegen-$KINDLEGEN_VERSION.tar.gz" -C /app \
&& rm "kindlegen-$KINDLEGEN_VERSION.tar.gz"
WORKDIR "$HOME"
USER kindlegen
# NOTE: https://kindlegen.s3.amazonaws.com/Readme.txt
ENTRYPOINT ["/app/kindlegen"]