Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to a debian-slim base image #105

Merged
merged 2 commits into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 10 additions & 17 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,29 +22,22 @@ RUN --mount=type=cache,target=/go/pkg/mod \
-o /out/preprocessing-worker \
./cmd/worker

# Build worker image
FROM alpine:3.20 AS preprocessing-worker
RUN apk add --update --no-cache libxml2-utils

# Copy the JRE (Eclipse Temurin v11) from the verapdf/cli image
ENV JAVA_HOME=/opt/java/openjdk
ENV PATH="${JAVA_HOME}/bin:${PATH}"
COPY --from=ghcr.io/verapdf/cli:latest --link $JAVA_HOME $JAVA_HOME
FROM debian:12-slim AS preprocessing-worker
RUN apt-get update && apt-get install -y --no-install-recommends \
libxml2-utils \
openjdk-17-jre-headless \
&& rm -rf /var/lib/apt/lists/*

ARG USER_ID=1000
ARG GROUP_ID=1000
RUN addgroup -g ${GROUP_ID} -S preprocessing
RUN adduser -u ${USER_ID} -S -D preprocessing preprocessing

# Make preprocessing the owner of the verapdf log dir
RUN mkdir --parents /var/opt/verapdf/logs && chown -R preprocessing:preprocessing /var/opt/verapdf
RUN groupadd --gid ${GROUP_ID} preprocessing && \
useradd --uid ${USER_ID} --gid preprocessing --create-home preprocessing && \
mkdir --parents /var/opt/verapdf/logs /home/preprocessing/shared && \
chown -R preprocessing:preprocessing /var/opt/verapdf /home/preprocessing

USER preprocessing

COPY --from=build-preprocessing-worker --link /out/preprocessing-worker /home/preprocessing/bin/preprocessing-worker
RUN mkdir /home/preprocessing/shared

# Copy the veraPDF application from the verapdf/cli image
COPY --from=ghcr.io/verapdf/cli:latest --link /opt/verapdf/ /opt/verapdf/
COPY --from=build-preprocessing-worker --link /out/preprocessing-worker /home/preprocessing/bin/preprocessing-worker

CMD ["/home/preprocessing/bin/preprocessing-worker"]
3 changes: 3 additions & 0 deletions hack/kube/overlays/enduro/preprocessing-secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ stringData:
[fileFormat]
allowlistPath = "/home/preprocessing/.config/allowed_file_formats.csv"

[filevalidate.verapdf]
path = "/opt/verapdf/verapdf"

allowed_file_formats.csv: |
Format name,PRONOM PUID
text,x-fmt/16
Expand Down
Loading