forked from koenrh/docker-kindlegen
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
27 lines (20 loc) · 983 Bytes
/
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.11.6@sha256:39eda93d15866957feaee28f8fc5adb545276a64147445c64992ef69804dbf01
LABEL maintainer "Koen Rouwhorst <[email protected]>"
# NOTE: 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://kindlegen.s3.amazonaws.com/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"]