Skip to content

Commit

Permalink
test: modernize pdfbox example
Browse files Browse the repository at this point in the history
Bump version to 3.0.3 and use the release chisel.
Note: had to add workaround due the missing CA certificate:

wget https://mirror.math.princeton.edu/pub/CTAN/fonts/opensans/type1/
--2024-09-17 15:05:03--  https://mirror.math.princeton.edu/pub/CTAN/fonts/opensans/type1/
Resolving mirror.math.princeton.edu (mirror.math.princeton.edu)... 128.112.18.21
Connecting to mirror.math.princeton.edu (mirror.math.princeton.edu)|128.112.18.21|:443... connected.
ERROR: cannot verify mirror.math.princeton.edu's certificate, issued by ‘CN=InCommon RSA Server CA 2,O=Internet2,C=US’:
  Unable to locally verify the issuer's authority.
To connect to mirror.math.princeton.edu insecurely, use `--no-check-certificate'.
  • Loading branch information
vpa1977 committed Sep 17, 2024
1 parent 0c9842c commit 58806f2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 22 deletions.
29 changes: 8 additions & 21 deletions tests/pdfbox/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,39 +4,26 @@ ARG USER=app
ARG UID=101
ARG GROUP=app
ARG GID=101

FROM golang:1.22 AS chisel
ARG UBUNTU_RELEASE
RUN git clone --depth 1 -b ubuntu-22.04 https://github.com/canonical/chisel-releases /opt/chisel-releases \
&& git clone --depth 1 -b main https://github.com/canonical/chisel /opt/chisel
WORKDIR /opt/chisel
RUN go generate internal/deb/version.go \
&& go build ./cmd/chisel
ARG CHISEL_VERSION=0.10.0
ARG TARGETARCH=amd64

FROM public.ecr.aws/ubuntu/ubuntu:$UBUNTU_RELEASE@sha256:1582c29f34a48752e406f1a261fe9545fad895da3f6bb4be55bc82485557564e AS builder
SHELL ["/bin/bash", "-oeux", "pipefail", "-c"]
ARG CHISEL_VERSION
ARG TARGETARCH
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y ca-certificates \
ca-certificates-java \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/*
COPY --from=chisel /opt/chisel/chisel /usr/bin/

### BOILERPLATE END ###

FROM builder AS sliced-deps
ARG USER
ARG UID
ARG GROUP
ARG GID
SHELL ["/bin/bash", "-oeux", "pipefail", "-c"]
COPY --from=chisel /opt/chisel-releases /opt/chisel-releases
ADD https://github.com/canonical/chisel/releases/download/v${CHISEL_VERSION}/chisel_v${CHISEL_VERSION}_linux_${TARGETARCH}.tar.gz chisel.tar.gz
RUN tar -xvf chisel.tar.gz -C /usr/bin/
RUN mkdir -p /rootfs \
&& chisel cut --release /opt/chisel-releases --root /rootfs \
&& chisel cut --root /rootfs \
liblcms2-2_libs \
libfontconfig1_libs \
libfreetype6_libs \
libjpeg-turbo8_libs

FROM $MAVEN_IMAGE
COPY --from=sliced-deps /rootfs /
COPY --from=builder /rootfs /
2 changes: 1 addition & 1 deletion tests/pdfbox/runtest
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ if [ -z $M2_CACHE ]; then
fi

PDFBOX_REPO=https://github.com/vpa1977/pdfbox
VERSION=3.0.0-alpha3
VERSION=3.0.3
APP=pdfbox
TEST_DIR=`pwd`

Expand Down

0 comments on commit 58806f2

Please sign in to comment.