MINOR: Fix prepare_docker_official_image_source.py leaking the ARG default into the ENV value - #23563
Merged
chia7712 merged 1 commit intoSep 23, 2026
Conversation
…fault into the ENV value Since apache#22054 and apache#23263 the jvm Dockerfile declares `ARG kafka_url=""`, but `prepare_docker_official_image_source.py` only replaces the `ARG kafka_url` prefix, so the generated Docker Official Image source ends up with ENV kafka_url https://archive.apache.org/dist/kafka/4.1.0/kafka_2.13-4.1.0.tgz="" and `docker_official_image_build_test.py` fails with a 404 from wget. Changes: - Replace the whole `ARG <name>[=<default>]` line with `ENV <name> <value>` using a line-anchored regex, so any default value is dropped. - Fail the script if an expected `ARG` line is missing instead of silently generating a broken Dockerfile.
mingyen066
force-pushed
the
fix-prepare-docker-official-image-source
branch
from
September 23, 2026 10:10
6aa53ad to
026b978
Compare
chia7712
pushed a commit
that referenced
this pull request
Sep 23, 2026
…fault into the ENV value (#23563) Since #22054 and #23263 the jvm Dockerfile declares `ARG kafka_url=""`, but `prepare_docker_official_image_source.py` only replaces the `ARG kafka_url` prefix, so the generated Docker Official Image source ends up with ``` ENV kafka_url https://archive.apache.org/.../kafka_2.13-4.1.0.tgz="" ``` and `docker_official_image_build_test.py` fails with a 404 from wget. Changes: - Replace the whole `ARG <name>[=<default>]` line with `ENV <name> <value>` using a line-anchored regex, so any default value is dropped. - Fail the script if an expected `ARG` line is missing instead of silently generating a broken Dockerfile. To verify, from `docker/`: ```bash python3 prepare_docker_official_image_source.py -type jvm -v 4.1.0 python3 docker_official_image_build_test.py kafka/test \ --image-tag=4.1.0 --kafka-version=4.1.0 -b ``` On trunk the build fails in the first RUN step with `wget ... ERROR 404: Not Found`; with this PR it completes. Reviewers: Chia-Ping Tsai <chia7712@gmail.com>, Maros Orsak <maros.orsak159@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Since #22054 and #23263 the jvm Dockerfile declares
ARG kafka_url="",but
prepare_docker_official_image_source.pyonly replaces theARG kafka_urlprefix, so the generated Docker Official Image source ends upwith
and
docker_official_image_build_test.pyfails with a 404 from wget.Changes:
ARG <name>[=<default>]line withENV <name> <value>using a line-anchored regex, so any default value is dropped.ARGline is missing instead ofsilently generating a broken Dockerfile.
To verify, from
docker/:python3 prepare_docker_official_image_source.py -type jvm -v 4.1.0 python3 docker_official_image_build_test.py kafka/test \ --image-tag=4.1.0 --kafka-version=4.1.0 -bOn trunk the build fails in the first RUN step with
wget ... ERROR 404: Not Found; with this PR it completes.Reviewers: Chia-Ping Tsai chia7712@gmail.com, Maros Orsak maros.orsak159@gmail.com