diff --git a/CHANGELOG.md b/CHANGELOG.md index f6e7c5bc5..80381997f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,6 +35,7 @@ All notable changes to this project will be documented in this file. - airflow,superset: Build from source ([#1304]). - kafka: Add updated JMX config `server.yaml` for KRaft ([#1308]). - airflow: Add apache-kafka provider plus dependencies to `3.0.6` image ([#1313]). +- airflow,superset: Reduce image size and add a snapshot of the source code ([#1326]). ### Changed @@ -122,6 +123,7 @@ All notable changes to this project will be documented in this file. [#1320]: https://github.com/stackabletech/docker-images/pull/1320 [#1322]: https://github.com/stackabletech/docker-images/pull/1322 [#1323]: https://github.com/stackabletech/docker-images/pull/1323 +[#1326]: https://github.com/stackabletech/docker-images/pull/1326 ## [25.7.0] - 2025-07-23 diff --git a/airflow/Dockerfile b/airflow/Dockerfile index 9cebd874d..9165d2918 100644 --- a/airflow/Dockerfile +++ b/airflow/Dockerfile @@ -77,7 +77,9 @@ RUN microdnf module enable -y nodejs:${NODEJS_VERSION} && \ npm \ nodejs \ # Needed to modify the SBOM - jq && \ + jq \ + # Needed to create the source code snapshot + tar && \ microdnf clean all && \ rm -rf /var/cache/yum @@ -103,6 +105,8 @@ uv tool install hatch cd "$(/stackable/patchable --images-repo-root=src checkout airflow ${PRODUCT_VERSION})" +tar -czf /stackable/airflow-${PRODUCT_VERSION}-src.tar.gz . + if [ -d "./airflow-core" ]; then # Airflow 3.x cd airflow-core/src/airflow/ui @@ -155,6 +159,10 @@ jq '.dependencies |= map(if .ref | test("^apache-airflow-providers-") then else . end)' /tmp/sbom.json > /stackable/app/airflow-${PRODUCT_VERSION}.cdx.json + +# Clean up build artifacts and temporary files to reduce image size +cd /stackable +rm -rf ./src EOF RUN <