@@ -337,11 +337,20 @@ acncli-image-name: # util target to print the CNI manager image name.
337337acncli-image-name-and-tag : # util target to print the CNI manager image name and tag.
338338 @echo $(IMAGE_REGISTRY ) /$(ACNCLI_IMAGE ) :$(ACNCLI_PLATFORM_TAG )
339339
340- acncli-image : # # build cni-manager container image.
340+ acncli-dockerfile-path :
341+ $(eval DOCKERFILE_PATH := $(ACNCLI_DIR ) /Dockerfile)
342+ @echo " $( DOCKERFILE_PATH) "
343+
344+ acncli-build-args :
345+ $(eval DOCKER_BUILD_ARGS := ;)
346+ @echo $(DOCKER_BUILD_ARGS )
347+
348+ acncli-image : acncli-dockerfile-path acncli-build-args # # build cni-manager container image.
341349 $(MAKE ) container \
342- DOCKERFILE=tools/acncli/Dockerfile \
350+ DOCKERFILE=$( DOCKERFILE_PATH ) \
343351 IMAGE=$(ACNCLI_IMAGE ) \
344- TAG=$(ACNCLI_PLATFORM_TAG )
352+ TAG=$(ACNCLI_PLATFORM_TAG ) \
353+ $(DOCKER_BUILD_ARGS )
345354
346355acncli-image-push : # # push cni-manager container image.
347356 $(MAKE ) container-push \
@@ -362,15 +371,24 @@ azure-ipam-image-name: # util target to print the azure-ipam image name.
362371azure-ipam-image-name-and-tag : # util target to print the azure-ipam image name and tag.
363372 @echo $(IMAGE_REGISTRY ) /$(AZURE_IPAM_IMAGE ) :$(AZURE_IPAM_PLATFORM_TAG )
364373
374+ azure-ipam-dockerfile-path :
375+ $(eval DOCKERFILE_PATH := $(AZURE_IPAM_DIR ) /Dockerfile)
376+ @echo " $( DOCKERFILE_PATH) "
377+
378+ azure-ipam-build-args :
379+ $(eval DOCKER_BUILD_ARGS := ;)
380+ @echo $(DOCKER_BUILD_ARGS )
381+
365382azure-ipam-image : # # build azure-ipam container image.
366383 $(MAKE ) container \
367- DOCKERFILE=azure-ipam/Dockerfile \
384+ DOCKERFILE=$( DOCKERFILE_PATH ) \
368385 IMAGE=$(AZURE_IPAM_IMAGE ) \
369386 PLATFORM=$(PLATFORM ) \
370387 TAG=$(AZURE_IPAM_PLATFORM_TAG ) \
371388 TARGET=$(OS ) \
372389 OS=$(OS ) \
373- ARCH=$(ARCH )
390+ ARCH=$(ARCH ) \
391+ $(DOCKER_BUILD_ARGS )
374392
375393azure-ipam-image-push : # # push azure-ipam container image.
376394 $(MAKE ) container-push \
@@ -390,11 +408,19 @@ ipv6-hp-bpf-image-name: # util target to print the ipv6-hp-bpf image name.
390408ipv6-hp-bpf-image-name-and-tag : # util target to print the ipv6-hp-bpf image name and tag.
391409 @echo $(IMAGE_REGISTRY ) /$(IPV6_HP_BPF_IMAGE ) :$(IPV6_HP_BPF_IMAGE_PLATFORM_TAG )
392410
411+ ipv6-hp-bpf-dockerfile-path :
412+ $(eval DOCKERFILE_PATH := $(IPV6_HP_BPF_DIR ) /$(OS ) .Dockerfile)
413+ @echo " $( DOCKERFILE_PATH) "
414+
415+ ipv6-hp-bpf-build-args :
416+ $(eval DOCKER_BUILD_ARGS := '--build-arg OS=$(OS ) --build-arg ARCH=$(ARCH ) --build-arg DEBUG=$(DEBUG ) ')
417+ @echo $(DOCKER_BUILD_ARGS )
418+
393419ipv6-hp-bpf-image : # # build ipv6-hp-bpf container image.
394420 $(MAKE ) container \
395- DOCKERFILE=bpf-prog/ipv6-hp-bpf/ $( OS ) .Dockerfile \
421+ DOCKERFILE=$( DOCKERFILE_PATH ) \
396422 IMAGE=$(IPV6_HP_BPF_IMAGE ) \
397- EXTRA_BUILD_ARGS=' --build-arg OS=$(OS) --build-arg ARCH=$(ARCH) --build-arg DEBUG=$(DEBUG )' \
423+ EXTRA_BUILD_ARGS=' $(DOCKER_BUILD_ARGS )' \
398424 PLATFORM=$(PLATFORM ) \
399425 TAG=$(IPV6_HP_BPF_IMAGE_PLATFORM_TAG ) \
400426 TARGET=$(OS ) \
@@ -419,16 +445,24 @@ cni-image-name: # util target to print the cni image name.
419445cni-image-name-and-tag : # util target to print the cni image name and tag.
420446 @echo $(IMAGE_REGISTRY ) /$(CNI_IMAGE ) :$(CNI_PLATFORM_TAG )
421447
448+ cni-image-dockerfile-path :
449+ $(eval DOCKERFILE_PATH := $(CNI_BUILD_DIR ) /Dockerfile)
450+ @echo " $( DOCKERFILE_PATH) "
451+
452+ cni-image-build-args :
453+ $(eval DOCKER_BUILD_ARGS='--build-arg CNI_AI_PATH=$(CNI_AI_PATH ) --build-arg CNI_AI_ID=$(CNI_AI_ID ) ')
454+ @echo $(DOCKER_BUILD_ARGS )
455+
422456cni-image : # # build cni container image.
423457 $(MAKE ) container \
424- DOCKERFILE=cni/Dockerfile \
458+ DOCKERFILE=$( DOCKERFILE_PATH ) \
425459 IMAGE=$(CNI_IMAGE ) \
426460 PLATFORM=$(PLATFORM ) \
427461 TAG=$(CNI_PLATFORM_TAG ) \
428462 TARGET=$(OS ) \
429463 OS=$(OS ) \
430464 ARCH=$(ARCH ) \
431- EXTRA_BUILD_ARGS=' --build-arg CNI_AI_PATH=$(CNI_AI_PATH) --build-arg CNI_AI_ID=$(CNI_AI_ID )'
465+ EXTRA_BUILD_ARGS=' $(DOCKER_BUILD_ARGS )'
432466
433467cni-image-push : # # push cni container image.
434468 $(MAKE ) container-push \
@@ -449,11 +483,19 @@ cns-image-name: # util target to print the CNS image name
449483cns-image-name-and-tag : # util target to print the CNS image name and tag.
450484 @echo $(IMAGE_REGISTRY ) /$(CNS_IMAGE ) :$(CNS_PLATFORM_TAG )
451485
486+ cns-image-dockerfile-path :
487+ $(eval DOCKERFILE_PATH := $(CNS_BUILD_DIR ) /Dockerfile)
488+ @echo " $( DOCKERFILE_PATH) "
489+
490+ cns-image-build-args :
491+ $(eval DOCKER_BUILD_ARGS='--build-arg CNS_AI_PATH=$(CNS_AI_PATH ) --build-arg CNS_AI_ID=$(CNS_AI_ID ) ')
492+ @echo $(DOCKER_BUILD_ARGS )
493+
452494cns-image : # # build cns container image.
453495 $(MAKE ) container \
454- DOCKERFILE=cns/Dockerfile \
496+ DOCKERFILE=$( DOCKERFILE_PATH ) \
455497 IMAGE=$(CNS_IMAGE ) \
456- EXTRA_BUILD_ARGS=' --build-arg CNS_AI_PATH=$(CNS_AI_PATH) --build-arg CNS_AI_ID=$(CNS_AI_ID )' \
498+ EXTRA_BUILD_ARGS=' $(DOCKER_BUILD_ARGS )' \
457499 PLATFORM=$(PLATFORM ) \
458500 TAG=$(CNS_PLATFORM_TAG ) \
459501 TARGET=$(OS ) \
@@ -478,11 +520,19 @@ npm-image-name: # util target to print the NPM image name
478520npm-image-name-and-tag : # util target to print the NPM image name and tag.
479521 @echo $(IMAGE_REGISTRY ) /$(NPM_IMAGE ) :$(NPM_PLATFORM_TAG )
480522
523+ npm-image-dockerfile-path :
524+ $(eval DOCKERFILE_PATH := $(NPM_BUILD_DIR ) /$(OS ) .Dockerfile)
525+ @echo " $( DOCKERFILE_PATH) "
526+
527+ npm-image-build-args :
528+ $(eval DOCKER_BUILD_ARGS='--build-arg NPM_AI_PATH=$(NPM_AI_PATH ) --build-arg NPM_AI_ID=$(NPM_AI_ID ) ')
529+ @echo $(DOCKER_BUILD_ARGS )
530+
481531npm-image : # # build the npm container image.
482532 $(MAKE ) container-$(CONTAINER_BUILDER ) \
483- DOCKERFILE=npm/ $( OS ) .Dockerfile \
533+ DOCKERFILE=$( DOCKERFILE_PATH ) \
484534 IMAGE=$(NPM_IMAGE ) \
485- EXTRA_BUILD_ARGS=' --build-arg NPM_AI_PATH=$(NPM_AI_PATH) --build-arg NPM_AI_ID=$(NPM_AI_ID )' \
535+ EXTRA_BUILD_ARGS=' $(DOCKER_BUILD_ARGS )' \
486536 PLATFORM=$(PLATFORM ) \
487537 TAG=$(NPM_PLATFORM_TAG ) \
488538 TARGET=$(OS ) \
0 commit comments