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


##########
docker/docker_build_test.py:
##########
@@ -75,11 +82,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 build_date={date.today()} 
--no-cache $DOCKER_DIR", args.image_type, args.kafka_archive)
+
     if args.test_only or not (args.build_only or args.test_only):
-        run_docker_tests(args.image, args.tag, args.kafka_url, args.image_type)
+        run_docker_tests(args.image, args.tag, args.kafka_url, 
args.image_type, container_runtime)

Review Comment:
   The `kafka_archive` should be passed to it. Otherwise, we can't use a local 
distribution to run the tests.



##########
docker/docker_build_test.py:
##########
@@ -75,11 +82,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 build_date={date.today()} 
--no-cache $DOCKER_DIR", args.image_type, args.kafka_archive)
+
     if args.test_only or not (args.build_only or args.test_only):
-        run_docker_tests(args.image, args.tag, args.kafka_url, args.image_type)
+        run_docker_tests(args.image, args.tag, args.kafka_url, 
args.image_type, container_runtime)

Review Comment:
   The #22987 incorporates this fix. I will merge this PR first



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