dino2895 commented on code in PR #22886:
URL: https://github.com/apache/kafka/pull/22886#discussion_r3738440716


##########
docker/docker_build_test.py:
##########
@@ -75,11 +75,13 @@ def run_docker_tests(image, tag, kafka_url, image_type):
 
     args = parser.parse_args()
 
+    container_runtime = detect_container_runtime()
+
     if args.build_only or not (args.build_only or args.test_only):
         if args.kafka_url:
-            build_docker_image_runner(f"docker build -f $DOCKER_FILE -t 
{args.image}:{args.tag} --build-arg kafka_url={args.kafka_url} --build-arg 
build_date={date.today()} --no-cache --progress=plain $DOCKER_DIR", 
args.image_type)
+            build_docker_image_runner(f"{container_runtime} build -f 
$DOCKER_FILE -t {args.image}:{args.tag} --build-arg kafka_url={args.kafka_url} 
--build-arg build_date={date.today()} --no-cache $DOCKER_DIR", args.image_type)
         elif args.kafka_archive:
-            build_docker_image_runner(f"docker build -f $DOCKER_FILE -t 
{args.image}:{args.tag} --build-arg build_date={date.today()} --no-cache 
--progress=plain $DOCKER_DIR", args.image_type, args.kafka_archive)
-    
+            build_docker_image_runner(f"{container_runtime} build -f 
$DOCKER_FILE -t {args.image}:{args.tag} --build-arg kafka_url= --build-arg 
build_date={date.today()} --no-cache $DOCKER_DIR", args.image_type, 
args.kafka_archive)

Review Comment:
   You're right, it isn't needed. I initially added it to explicitly select the 
local-archive path, but `ARG kafka_url `already evaluates to an empty value 
when the build argument is omitted. The archive path is passed separately 
through `args.kafka_archive` and copied into the build context as `kafka.tgz`, 
so removing `--build-arg kafka_url=` does not change the local archive 
behavior. I've removed it.



-- 
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]

Reply via email to