-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
45 lines (33 loc) · 1011 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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
FROM alpine:3.19.1@sha256:c5b1261d6d3e43071626931fc004f70149baeba2c8ec672bd4f27761f8e1ad6b
HEALTHCHECK NONE
ENTRYPOINT []
ARG USER_NAME=default
ARG USER_HOME=/home/default
ARG USER_ID=1000
ARG USER_GECOS=Default
# hadolint ignore=DL3018
RUN apk --update --no-cache add \
curl \
ghostscript \
jq \
ocrmypdf \
openjdk21-jre-headless \
pdfgrep \
qpdf \
&& rm -rf /var/cache/apk/*
SHELL ["/bin/ash", "-eo", "pipefail", "-c"]
RUN VERSION=$(curl -s -S -f https://gitlab.com/api/v4/projects/5024297/releases | jq -r '.[0].tag_name') \
&& mkdir -p /opt/pdftk/lib \
&& curl -s -S -f -o /opt/pdftk/lib/pdftk-all.jar \
"https://gitlab.com/api/v4/projects/5024297/packages/generic/pdftk-java/${VERSION}/pdftk-all.jar"
COPY pdftk /usr/bin/pdftk
RUN chmod 755 /usr/bin/pdftk
RUN adduser \
--home "${USER_HOME}" \
--uid "${USER_ID}" \
--gecos "${USER_GECOS}" \
--disabled-password \
"${USER_NAME}"
ENV HOME="${USER_HOME}"
USER "${USER_NAME}"
WORKDIR "${HOME}"