@@ -24,6 +24,7 @@ image_tag="7"
2424iteration =0
2525local_code_path =0
2626openresty ="openresty"
27+ openresty_version ="1.19.3.2.0"
2728artifact ="0"
2829apisix_repo ="https://github.com/apache/apisix"
2930dashboard_repo ="https://github.com/apache/apisix-dashboard"
@@ -67,6 +68,34 @@ define build
6768endef
6869endif
6970
71+ # ## function for building image
72+ # ## $(1) is name
73+ # ## $(2) is dockerfile filename
74+ # ## $(3) is package type
75+ # ## $(4) is openresty image name
76+ # ## $(5) is openresty image version
77+ # ## $(6) is code path
78+ ifneq ($(buildx ) , True)
79+ define build-image
80+ docker build -t apache/$(1 ) -$(3 ) :$(version ) \
81+ --build-arg OPENRESTY_NAME=$(4 ) \
82+ --build-arg OPENRESTY_VERSION=$(5 ) \
83+ --build-arg CODE_PATH=$(6 ) \
84+ -f ./dockerfiles/Dockerfile.$(2 ) .$(3 ) .
85+ endef
86+ else
87+ define build-image
88+ docker buildx build -t apache/$(1 ) -$(3 ) :$(version ) \
89+ --build-arg OPENRESTY_NAME=$(4 ) \
90+ --build-arg OPENRESTY_VERSION=$(5 ) \
91+ --build-arg CODE_PATH=$(6 ) \
92+ --load \
93+ --cache-from=$(cache_from ) \
94+ --cache-to=$(cache_to ) \
95+ -f ./dockerfiles/Dockerfile.$(2 ) .$(3 ) .
96+ endef
97+ endif
98+
7099# ## function for packing
71100# ## $(1) is name
72101# ## $(2) is package type
@@ -120,7 +149,7 @@ package-apisix-deb:
120149.PHONY : build-apisix-alpine-image
121150build-apisix-alpine-image :
122151 $(call build,apisix-openresty,apisix-openresty,apk,$(local_code_path ) )
123- $(call build,apisix,apisix,alpine,$(local_code_path ) )
152+ $(call build-image ,apisix,apisix,alpine,apisix-openresty, $( openresty_version ) ,$(local_code_path ) )
124153
125154
126155# ## build dashboard:
0 commit comments