see-quick commented on code in PR #23560: URL: https://github.com/apache/kafka/pull/23560#discussion_r4228081127
########## docker/README.md: ########## @@ -130,6 +130,10 @@ python docker_build_test.py kafka/test --image-tag=3.6.0 --image-type=jvm --kafk ``` python docker_build_test.py kafka/test --image-tag=3.8.0 --image-type=native --kafka-url=https://archive.apache.org/dist/kafka/3.8.0/kafka_2.13-3.8.0.tgz ``` +- Example(jvm, custom base image) :- The jvm image is built on `eclipse-temurin:25-jre-alpine` by default. Any Alpine-based image carrying a JRE can be used instead, e.g. to build on a different JDK version, by passing `--base-image` +``` +python docker_build_test.py kafka/test --image-tag=3.6.0 --image-type=jvm --base-image=docker.io/library/eclipse-temurin:25-jre-alpine --kafka-url=https://archive.apache.org/dist/kafka/3.6.0/kafka_2.13-3.6.0.tgz Review Comment: Ah, good catch. I did this readme before there was this update to Java 25. So I can move this example to Java 21. ########## docker/prepare_docker_official_image_source.py: ########## @@ -49,6 +49,10 @@ def replace_arg_with_env(filedata, arg_name, value): def remove_args_and_hardcode_values(file_path, kafka_version, kafka_url): with open(file_path, 'r') as file: filedata = file.read() + # Docker Official Images require literal FROM lines, so inline the default base image + # and drop the ARG together with the comment explaining how to override it. + base_image = re.search(r"^(?:#.*\n)*ARG base_image=(\S+)\n\n", filedata, re.MULTILINE) + filedata = filedata.replace(base_image.group(0), "").replace("${base_image}", base_image.group(1)) Review Comment: Yeah, make sense. Updated. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
