@@ -5,7 +5,9 @@ CHART_DIR = $(SELF_DIR)charts/nginx-gateway-fabric
55NGINX_CONF_DIR  = internal/controller/nginx/conf
66NJS_DIR  = internal/controller/nginx/modules/src
77KIND_CONFIG_FILE  = $(SELF_DIR ) config/cluster/kind-cluster.yaml
8+ NAP_WAF_ALPINE_VERSION  = 3.19
89NGINX_DOCKER_BUILD_PLUS_ARGS  = --secret id=nginx-repo.crt,src=$(SELF_DIR ) nginx-repo.crt --secret id=nginx-repo.key,src=$(SELF_DIR ) nginx-repo.key
10+ NGINX_DOCKER_BUILD_NAP_WAF_ARGS  = --build-arg ALPINE_VERSION=$(NAP_WAF_ALPINE_VERSION )  --build-arg INCLUDE_NAP_WAF=true
911BUILD_AGENT  = local
1012
1113PROD_TELEMETRY_ENDPOINT  = oss.edge.df.f5.com:443
@@ -43,6 +45,7 @@ HELM_SCHEMA_VERSION = 0.18.1
4345PREFIX  ?= nginx-gateway-fabric# # The name of the NGF image. For example, nginx-gateway-fabric
4446NGINX_PREFIX ?= $(PREFIX ) /nginx# # The name of the nginx image. For example: nginx-gateway-fabric/nginx
4547NGINX_PLUS_PREFIX ?= $(PREFIX ) /nginx-plus# # The name of the nginx plus image. For example: nginx-gateway-fabric/nginx-plus
48+ NGINX_PLUS_WAF_PREFIX ?= $(PREFIX ) /nginx-plus-waf# # The name of the nginx plus image with NAP WAF. For example: nginx-gateway-fabric/nginx-plus-waf
4649TAG ?= $(VERSION:v%=% ) # # The tag of the image. For example, 1.1.0
4750TARGET ?= local# # The target of the build. Possible values: local and container
4851OUT_DIR ?= build/out# # The folder where the binary will be stored
@@ -77,6 +80,9 @@ build-images: build-ngf-image build-nginx-image ## Build the NGF and nginx docke
7780.PHONY : build-images-with-plus
7881build-images-with-plus : build-ngf-image build-nginx-plus-image # # Build the NGF and NGINX Plus docker images
7982
83+ .PHONY : build-images-nap-waf
84+ build-images-with-nap-waf : build-ngf-image build-nginx-plus-image-with-nap-waf # # Build the NGF and NGINX Plus with WAF docker images
85+ 
8086.PHONY : build-prod-ngf-image
8187build-prod-ngf-image : TELEMETRY_ENDPOINT=$(PROD_TELEMETRY_ENDPOINT ) 
8288build-prod-ngf-image : build-ngf-image # # Build the NGF docker image for production
@@ -99,6 +105,13 @@ build-prod-nginx-plus-image: build-nginx-plus-image ## Build the custom nginx pl
99105build-nginx-plus-image : check-for-docker # # Build the custom nginx plus image
100106	docker build --platform linux/$(GOARCH )  $(strip  $(NGINX_DOCKER_BUILD_OPTIONS ) )  $(strip  $(NGINX_DOCKER_BUILD_PLUS_ARGS ) )   -f $(SELF_DIR ) build/Dockerfile.nginxplus -t $(strip  $(NGINX_PLUS_PREFIX ) ) :$(strip  $(TAG ) )  $(strip  $(SELF_DIR ) ) 
101107
108+ .PHONY : build-nginx-plus-image-with-nap-waf
109+ build-nginx-plus-image-with-nap-waf : check-for-docker # # Build the custom nginx plus image with NAP WAF. Note that arm is NOT supported.
110+ 	@if [ $( GOARCH) =  " arm64" ;  then  \ 
111+ 		echo  " \033[0;31mIMPORTANT:\033[0m The nginx-plus-waf image cannot be built for arm64 architecture and will be built for amd64." ;  \ 
112+ 	fi 
113+ 	docker build --platform linux/amd64 $(strip  $(NGINX_DOCKER_BUILD_OPTIONS ) )  $(strip  $(NGINX_DOCKER_BUILD_PLUS_ARGS ) )  $(strip  $(NGINX_DOCKER_BUILD_NAP_WAF_ARGS ) )  -f $(SELF_DIR ) build/Dockerfile.nginxplus -t $(strip  $(NGINX_PLUS_WAF_PREFIX ) ) :$(strip  $(TAG ) )  $(strip  $(SELF_DIR ) ) 
114+ 
102115.PHONY : check-for-docker
103116check-for-docker : # # Check if Docker is installed
104117	@docker -v ||  (code=$$ ? ;  printf  " \033[0;31mError\033[0m: there was a problem with Docker\n" ;  exit  $$ code)
0 commit comments