From 58806f2b4bdbb132bf2a58ed9a25f5c3a9879fe6 Mon Sep 17 00:00:00 2001 From: Vladimir Petko Date: Tue, 17 Sep 2024 15:05:40 +1200 Subject: [PATCH] test: modernize pdfbox example MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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'. --- tests/pdfbox/Dockerfile | 29 ++++++++--------------------- tests/pdfbox/runtest | 2 +- 2 files changed, 9 insertions(+), 22 deletions(-) diff --git a/tests/pdfbox/Dockerfile b/tests/pdfbox/Dockerfile index c14df44..b26472a 100644 --- a/tests/pdfbox/Dockerfile +++ b/tests/pdfbox/Dockerfile @@ -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 / diff --git a/tests/pdfbox/runtest b/tests/pdfbox/runtest index 0b8249d..2d49a21 100755 --- a/tests/pdfbox/runtest +++ b/tests/pdfbox/runtest @@ -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`