diff --git a/.github/workflows/bumpVersions.yml b/.github/workflows/bumpVersions.yml index 1ecd7f3..f893584 100644 --- a/.github/workflows/bumpVersions.yml +++ b/.github/workflows/bumpVersions.yml @@ -26,9 +26,11 @@ jobs: matrix: include: - tomcat_major: 10 - tcnative_source_pattern: 1 + tcnative_source_pattern: 2 + apr_source_pattern: 1 - tomcat_major: 9 - tcnative_source_pattern: 1 + tcnative_source_pattern: 2 + apr_source_pattern: 1 steps: - name: Checkout uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 @@ -53,6 +55,7 @@ jobs: run: | echo "TOMCAT_MAJOR=${{ matrix.tomcat_major }}" >> $GITHUB_ENV echo "TCNATIVE_SOURCE_PATTERN=${{ matrix.tcnative_source_pattern }}" >> $GITHUB_ENV + echo "APR_SOURCE_PATTERN=${{ matrix.apr_source_pattern }}" >> $GITHUB_ENV - name: Run updatecli run: | diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 91f63b4..b075cf4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -82,6 +82,9 @@ jobs: echo "tcnative_version=$(jq -r .tcnative_version tomcat${{ matrix.tomcat_major }}.json)" >> $GITHUB_OUTPUT echo "tcnative_sha512=$(jq -r .tcnative_sha512 tomcat${{ matrix.tomcat_major }}.json)" >> $GITHUB_OUTPUT + echo "apr_version=$(jq -r .apr_version tomcat${{ matrix.tomcat_major }}.json)" >> $GITHUB_OUTPUT + echo "apr_sha256=$(jq -r .apr_sha256 tomcat${{ matrix.tomcat_major }}.json)" >> $GITHUB_OUTPUT + - name: Login to quay.io uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0 with: @@ -109,6 +112,8 @@ jobs: TOMCAT_SHA512=${{ steps.vars.outputs.tomcat_sha512 }} TCNATIVE_VERSION=${{ steps.vars.outputs.tcnative_version }} TCNATIVE_SHA512=${{ steps.vars.outputs.tcnative_sha512 }} + APR_VERSION=${{ steps.vars.outputs.apr_version }} + APR_SHA256=${{ steps.vars.outputs.apr_sha256 }} tags: local/${{ env.IMAGE_REPOSITORY }}:ci - name: Test Built Image @@ -143,6 +148,8 @@ jobs: TOMCAT_SHA512=${{ steps.vars.outputs.tomcat_sha512 }} TCNATIVE_VERSION=${{ steps.vars.outputs.tcnative_version }} TCNATIVE_SHA512=${{ steps.vars.outputs.tcnative_sha512 }} + APR_VERSION=${{ steps.vars.outputs.apr_version }} + APR_SHA256=${{ steps.vars.outputs.apr_sha256 }} REVISION=${{ github.run_number }} CREATED=${{ steps.vars.outputs.image_created }} tags: | diff --git a/Dockerfile b/Dockerfile index ebdd28d..687013a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ # Alfresco Base Tomcat Image # see also https://github.com/docker-library/tomcat ARG JAVA_MAJOR -ARG DISTRIB_NAME +ARG DISTRIB_NAME=rockylinux ARG DISTRIB_MAJOR ARG IMAGE_JAVA_REPO=quay.io/alfresco ARG IMAGE_JAVA_NAME=alfresco-base-java @@ -15,14 +15,17 @@ ARG TOMCAT_VERSION ARG TOMCAT_SHA512 ARG TCNATIVE_VERSION ARG TCNATIVE_SHA512 +ARG APR_VERSION +ARG APR_SHA256 ENV APACHE_MIRRORS="https://archive.apache.org/dist https://dlcdn.apache.org https://downloads.apache.org" ENV DEBIAN_FRONTEND=noninteractive SHELL ["/bin/bash", "-euo", "pipefail", "-c"] RUN apt-get -y update && apt-get -y install xmlstarlet curl gpg; \ - mkdir -p /build/{tcnative,tomcat}; \ + mkdir -p /build/{apr,tcnative,tomcat}; \ active_mirror=; \ for mirror in $APACHE_MIRRORS; do \ if curl -fsSL ${mirror}/tomcat/tomcat-${TOMCAT_MAJOR}/KEYS | gpg --import; then \ + curl -fsSL ${mirror}/apr/KEYS | gpg --import; \ active_mirror=$mirror; \ break; \ fi; \ @@ -33,15 +36,19 @@ RUN apt-get -y update && apt-get -y install xmlstarlet curl gpg; \ for filetype in '.tar.gz' '.tar.gz.asc'; do \ curl -fsSLo tomcat${filetype} ${active_mirror}/tomcat/tomcat-${TOMCAT_MAJOR}/v${TOMCAT_VERSION}/bin/apache-tomcat-${TOMCAT_VERSION}${filetype}; \ curl -fsSLo tcnative${filetype} ${active_mirror}/tomcat/tomcat-connectors/native/${TCNATIVE_VERSION}/source/tomcat-native-${TCNATIVE_VERSION}-src${filetype}; \ + curl -fsSLo apr${filetype} ${active_mirror}/apr/apr-${APR_VERSION}${filetype}; \ done; \ \ echo "$TOMCAT_SHA512 *tomcat.tar.gz" | sha512sum -c - || (echo "Checksum did't match: $(sha512sum *tomcat.tar.gz)" && exit 1); \ echo "$TCNATIVE_SHA512 *tcnative.tar.gz" | sha512sum -c - || (echo "Checksum did't match: $(sha512sum *tcnative.tar.gz)" && exit 1); \ + echo "$APR_SHA256 *apr.tar.gz" | sha256sum -c - || (echo "Checksum did't match: $(sha256sum *apr.tar.gz)" && exit 1); \ \ gpg --batch --verify tcnative.tar.gz.asc tcnative.tar.gz && \ gpg --batch --verify tomcat.tar.gz.asc tomcat.tar.gz && \ + gpg --batch --verify apr.tar.gz.asc apr.tar.gz && \ tar -zxf tomcat.tar.gz -C /build/tomcat --strip-components=1 && \ - tar -zxf tcnative.tar.gz -C /build/tcnative --strip-components=1 + tar -zxf tcnative.tar.gz -C /build/tcnative --strip-components=1 && \ + tar -zxf apr.tar.gz -C /build/apr --strip-components=1 WORKDIR /build/tomcat # sh removes env vars it doesn't support (ones with periods) # https://github.com/docker-library/tomcat/issues/77 @@ -77,30 +84,55 @@ RUN xmlstarlet ed -L \ # Remove unwanted files from distribution RUN rm -fr webapps/* *.txt *.md RELEASE-NOTES logs/ temp/ work/ bin/*.bat +# hadolint ignore=DL3041 FROM ${IMAGE_JAVA_REPO}/${IMAGE_JAVA_NAME}:${IMAGE_JAVA_TAG} AS tcnative_build-rockylinux +ARG DISTRIB_MAJOR ARG JAVA_MAJOR ENV JAVA_HOME=/usr/lib/jvm/java-openjdk ARG BUILD_DIR=/build ARG INSTALL_DIR=/usr/local COPY --from=tomcat_dist /build/tcnative $BUILD_DIR/tcnative -WORKDIR ${BUILD_DIR}/tcnative/native +COPY --from=tomcat_dist /build/apr $BUILD_DIR/apr SHELL ["/bin/bash", "-euo", "pipefail", "-c"] -RUN yum install -y gcc make openssl-devel expat-devel java-${JAVA_MAJOR}-openjdk-devel apr-devel redhat-rpm-config && yum clean all; \ +RUN <&2 diff --git a/tomcat10.json b/tomcat10.json index 49020e9..24326d1 100644 --- a/tomcat10.json +++ b/tomcat10.json @@ -1,6 +1,8 @@ { - "tcnative_sha512": "06951c67d2739ab9205a537d24345e13e4472f192602fc52015ea84612c6e2c9334404b30a82be7d1e7d4ce470ea9df8b1b8ca1a3b8674d82706ff432280724f", - "tcnative_version": "1.3.1", + "tcnative_sha512": "fd45533b9c34b008717d18ed49334c7286b93c849c487c1c42746f2998cc4a6ff0362e536a8b5124c6539847a92a9f7631c7638a21cd5d22134fe1a9bb0f0702", + "tcnative_version": "2.0.8", "tomcat_sha512": "0e3d423a843e2d9ba4f28a9f0a2f1073d5a1389557dfda041759f8df968bace63cd6948bd76df2727b5133ddb7c33e05dab43cea1d519ca0b6d519461152cce9", - "tomcat_version": "10.1.31" + "tomcat_version": "10.1.31", + "apr_version": "1.7.5", + "apr_sha256": "3375fa365d67bcf945e52b52cba07abea57ef530f40b281ffbe977a9251361db" } diff --git a/tomcat9.json b/tomcat9.json index b148cc2..bfce78e 100644 --- a/tomcat9.json +++ b/tomcat9.json @@ -1,6 +1,8 @@ { - "tcnative_sha512": "06951c67d2739ab9205a537d24345e13e4472f192602fc52015ea84612c6e2c9334404b30a82be7d1e7d4ce470ea9df8b1b8ca1a3b8674d82706ff432280724f", - "tcnative_version": "1.3.1", + "tcnative_sha512": "fd45533b9c34b008717d18ed49334c7286b93c849c487c1c42746f2998cc4a6ff0362e536a8b5124c6539847a92a9f7631c7638a21cd5d22134fe1a9bb0f0702", + "tcnative_version": "2.0.8", "tomcat_sha512": "ef3ac81debbc3a519c43d1fdb1c88ab26a8052af424d81bceccfbd6e663050a06d7aad7960fd5d11c17849829daebbebf33d92ac1158902283d0e534514aab93", - "tomcat_version": "9.0.96" + "tomcat_version": "9.0.96", + "apr_version": "1.7.5", + "apr_sha256": "3375fa365d67bcf945e52b52cba07abea57ef530f40b281ffbe977a9251361db" } diff --git a/updatecli.d/01_tomcat_version.tpl b/updatecli.d/01_tomcat_version.tpl index 8ab3f75..37254c7 100644 --- a/updatecli.d/01_tomcat_version.tpl +++ b/updatecli.d/01_tomcat_version.tpl @@ -6,6 +6,11 @@ scms: spec: url: https://github.com/apache/tomcat-native.git branch: main + aprGitHub: + kind: git + spec: + url: https://github.com/apache/apr.git + branch: trunk sources: tomcatVersion: @@ -24,19 +29,34 @@ sources: versionfilter: kind: semver pattern: "~{{ requiredEnv "TCNATIVE_SOURCE_PATTERN" }}" + aprTag: + name: Get Apache APR library version + kind: gittag + scmid: aprGitHub + spec: + versionfilter: + kind: semver + pattern: "~{{ requiredEnv "APR_SOURCE_PATTERN" }}" targets: tomcatJson: - name: Update version in json target + name: Update Tomcat version in json target kind: json sourceid: tomcatVersion spec: file: tomcat{{ requiredEnv "TOMCAT_MAJOR" }}.json key: tomcat_version tcnativeJson: - name: Update version in json target + name: Update TCnative version in json target kind: json sourceid: tcnativeTag spec: file: tomcat{{ requiredEnv "TOMCAT_MAJOR" }}.json key: tcnative_version + aprJson: + name: Update APR version in json target + kind: json + sourceid: aprTag + spec: + file: tomcat{{ requiredEnv "TOMCAT_MAJOR" }}.json + key: apr_version diff --git a/updatecli.d/02_tomcat_checksum.tpl b/updatecli.d/02_tomcat_checksum.tpl index 7fe9719..f7da8f9 100644 --- a/updatecli.d/02_tomcat_checksum.tpl +++ b/updatecli.d/02_tomcat_checksum.tpl @@ -17,19 +17,34 @@ sources: environments: - name: PATH - name: TOMCAT_MAJOR + aprChecksum: + name: Retrieve the Apache APR libs checksum + kind: shell + spec: + command: ./get-checksum.sh apr + environments: + - name: PATH + - name: TOMCAT_MAJOR targets: tomcatJson: - name: Update version in json target + name: Update Tomcat checksum in json target kind: json sourceid: tomcatChecksum spec: file: tomcat{{ requiredEnv "TOMCAT_MAJOR" }}.json key: tomcat_sha512 tcnativeJson: - name: Update version in json target + name: Update Tcnative libs checksum in json target kind: json sourceid: tcnativeChecksum spec: file: tomcat{{ requiredEnv "TOMCAT_MAJOR" }}.json key: tcnative_sha512 + aprJson: + name: Update APR checksum in json target + kind: json + sourceid: aprChecksum + spec: + file: tomcat{{ requiredEnv "TOMCAT_MAJOR" }}.json + key: apr_sha256