@@ -27,6 +27,8 @@ RUN curl "https://repo.stackable.tech/repository/packages/trino-server/trino-ser
2727COPY --chown=${STACKABLE_USER_UID}:0 trino/stackable/patches/apply_patches.sh /stackable/trino-server-${PRODUCT}-src/patches/apply_patches.sh
2828COPY --chown=${STACKABLE_USER_UID}:0 trino/stackable/patches/${PRODUCT} /stackable/trino-server-${PRODUCT}-src/patches/${PRODUCT}
2929COPY --chown=${STACKABLE_USER_UID}:0 --from=trino-storage-connector-image /stackable/trino-storage-${PRODUCT}-src/target/trino-storage-${PRODUCT} /trino-storage-${PRODUCT}
30+ # do not copy patches -> .dockerignore?
31+ COPY --chown=${STACKABLE_USER_UID}:0 trino/stackable/jmx /stackable/jmx
3032
3133# adding a hadolint ignore for SC2215, due to https://github.com/hadolint/hadolint/issues/980
3234# hadolint ignore=SC2215
@@ -49,19 +51,19 @@ git tag ${PRODUCT}
4951# We need to use ./mvnw instead of mvn to get a recent maven version (which is required to build Trino)
5052./mvnw --batch-mode --no-transfer-progress package -DskipTests --projects="!docs,!core/trino-server-rpm"
5153
52- # Delete the worst intermediate build products to free some space
54+ # Delete intermediate build products to free some space and keep runners happy
5355rm -r /stackable/trino-server-${PRODUCT}-src/plugin/*/target /stackable/trino-server-${PRODUCT}-src/core/trino-server/target/trino-server-${PRODUCT}
5456
5557# Extract from tarball to save space; the tarball deduplicates jars (replacing them with symlinks),
5658# while the raw output folder does not
5759tar -xzf /stackable/trino-server-${PRODUCT}-src/core/trino-server/target/trino-server-${PRODUCT}.tar.gz -C /stackable
5860mv /stackable/trino-server-${PRODUCT}-src/core/trino-server/target/bom.json /stackable/trino-server-${PRODUCT}/trino-server-${PRODUCT}.cdx.json
5961
60- # Delete all intermediate build products to free some more space
62+ # Delete intermediate build products to free some space and keep runners happy
6163rm -r /stackable/trino-server-${PRODUCT}-src
64+ rm -r /stackable/.m2
6265
6366# JMX Exporter
64- mkdir /stackable/jmx
6567curl --fail https://repo.stackable.tech/repository/packages/jmx-exporter/jmx_prometheus_javaagent-${JMX_EXPORTER}.jar -o /stackable/jmx/jmx_prometheus_javaagent-${JMX_EXPORTER}.jar
6668chmod +x /stackable/jmx/jmx_prometheus_javaagent-${JMX_EXPORTER}.jar
6769# Storage connector
@@ -70,8 +72,7 @@ mv /trino-storage-${PRODUCT}/ /stackable/trino-server-${PRODUCT}/plugin/trino-st
7072ln -s /stackable/jmx/jmx_prometheus_javaagent-${JMX_EXPORTER}.jar /stackable/jmx/jmx_prometheus_javaagent.jar
7173ln -s /stackable/trino-server-${PRODUCT} /stackable/trino-server
7274# We need to change groups here and not in the final image (file changes bloat images)
73- chmod -R g=u /stackable/trino-server-${PRODUCT}
74- chmod -R g=u /stackable/jmx
75+ chmod -R g=u /stackable
7576EOF
7677
7778FROM stackable/image/java-base
@@ -101,10 +102,11 @@ RUN microdnf update && \
101102
102103WORKDIR /stackable
103104
104- COPY --from=trino-builder --chown=${STACKABLE_USER_UID}:0 /stackable/trino-server-${PRODUCT} /stackable/trino-server-${PRODUCT}
105- COPY --from=trino-builder --chown=${STACKABLE_USER_UID}:0 /stackable/jmx /stackable/jmx
106- # do not copy patches -> .dockerignore?
107- COPY --chown=${STACKABLE_USER_UID}:0 trino/stackable/jmx /stackable/jmx
105+ # If /stackable has any build artifacts / leftovers make sure its removed properly
106+ # or only copy what is actually required in the final image like:
107+ # COPY --from=trino-builder --chown=${STACKABLE_USER_UID}:0 /stackable/foo /stackable/foo
108+ COPY --from=trino-builder --chown=${STACKABLE_USER_UID}:0 /stackable /stackable
109+
108110COPY --chown=${STACKABLE_USER_UID}:0 trino/licenses /licenses
109111
110112# ----------------------------------------
0 commit comments