Skip to content

Commit

Permalink
Switch to alpine 3.19.1 (#31)
Browse files Browse the repository at this point in the history
* Switch to pdftk-java to allow alpine upgrade
  • Loading branch information
thomasleplus authored Apr 24, 2024
1 parent de61650 commit 12faa99
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
18 changes: 15 additions & 3 deletions pdf/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Package pdftk requires alpine 3.8.5 or below
FROM alpine:3.8.5@sha256:2bb501e6173d9d006e56de5bce2720eb06396803300fe1687b58a7ff32bf4c14
FROM alpine:3.19.1@sha256:c5b1261d6d3e43071626931fc004f70149baeba2c8ec672bd4f27761f8e1ad6b

HEALTHCHECK NONE

Expand All @@ -12,13 +11,26 @@ ARG USER_GECOS=Default

# hadolint ignore=DL3018
RUN apk --update --no-cache add \
curl \
ghostscript \
jq \
ocrmypdf \
openjdk21-jre-headless \
pdfgrep \
pdftk \
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}" \
Expand Down
3 changes: 3 additions & 0 deletions pdf/pdftk
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

java -jar /opt/pdftk/lib/pdftk-all.jar "${@}"

0 comments on commit 12faa99

Please sign in to comment.