You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kafka.apache.org by ma...@apache.org on 2024/06/10 12:35:25 UTC
(kafka) 02/02: [MINOR] KAFKA-16373: KIP-1028: Modifying dockerfile comments (#16261)
This is an automated email from the ASF dual-hosted git repository.
manikumar pushed a commit to branch 3.8
in repository https://gitbox.apache.org/repos/asf/kafka.git
commit 113baae977ce0466558eafbbb5281e0b0cb151b0
Author: KrishVora01 <15...@users.noreply.github.com>
AuthorDate: Mon Jun 10 14:55:55 2024 +0530
[MINOR] KAFKA-16373: KIP-1028: Modifying dockerfile comments (#16261)
This PR aims to add the replace the dockerfile comments under the jvm/dockerfile Dockerfile, with updated url.
The original comment read
# Get kafka from https://archive.apache.org/dist/kafka and pass the url through build arguments . For DOI dockerfiles, we replace this with
# Get Kafka from https://downloads.apache.org/kafka, url passed as env var, for version {kafka_version} .
Reviewers: Manikumar Reddy <ma...@gmail.com>, Vedarth Sharma <ve...@confluent.io>
---
docker/prepare_docker_official_image_source.py | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/docker/prepare_docker_official_image_source.py b/docker/prepare_docker_official_image_source.py
index a39915c9e51..10b4f04d78f 100644
--- a/docker/prepare_docker_official_image_source.py
+++ b/docker/prepare_docker_official_image_source.py
@@ -36,14 +36,18 @@ import argparse
from distutils.dir_util import copy_tree
import os
import shutil
+import re
-def remove_args_and_hardcode_values(file_path, kafka_url):
+def remove_args_and_hardcode_values(file_path, kafka_version, kafka_url):
with open(file_path, 'r') as file:
filedata = file.read()
filedata = filedata.replace("ARG kafka_url", f"ENV kafka_url {kafka_url}")
filedata = filedata.replace(
"ARG build_date", f"ENV build_date {str(date.today())}")
+ original_comment = re.compile(r"# Get kafka from https://archive.apache.org/dist/kafka and pass the url through build arguments")
+ updated_comment = f"# Get Kafka from https://downloads.apache.org/kafka, url passed as env var, for version {kafka_version}"
+ filedata = original_comment.sub(updated_comment, filedata)
with open(file_path, 'w') as file:
file.write(filedata)
@@ -65,4 +69,4 @@ if __name__ == '__main__':
copy_tree(os.path.join(current_dir, args.image_type), os.path.join(new_dir, args.kafka_version, args.image_type))
copy_tree(os.path.join(current_dir, 'resources'), os.path.join(new_dir, args.kafka_version, args.image_type, 'resources'))
remove_args_and_hardcode_values(
- os.path.join(new_dir, args.kafka_version, args.image_type, 'Dockerfile'), kafka_url)
+ os.path.join(new_dir, args.kafka_version, args.image_type, 'Dockerfile'), args.kafka_version, kafka_url)