Skip to content

Commit 97f7b94

Browse files
committed
fix: the image name of apisix-openresty which is based by apisix-alpine
1 parent 48b4801 commit 97f7b94

File tree

2 files changed

+33
-3
lines changed

2 files changed

+33
-3
lines changed

Makefile

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ image_tag="7"
2424
iteration=0
2525
local_code_path=0
2626
openresty="openresty"
27+
openresty_version="1.19.3.2.0"
2728
artifact="0"
2829
apisix_repo="https://github.com/apache/apisix"
2930
dashboard_repo="https://github.com/apache/apisix-dashboard"
@@ -67,6 +68,34 @@ define build
6768
endef
6869
endif
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
121150
build-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:

dockerfiles/Dockerfile.apisix.alpine

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
ARG ENABLE_PROXY=false
2-
ARG VERSION
2+
ARG OPENRESTY_VERSION
3+
ARG OPENRESTY_NAME
34

4-
FROM apache/apisix-alpine:${VERSION} AS production-stage
5+
FROM apache/${OPENRESTY_NAME}:${OPENRESTY_VERSION} AS production-stage
56

67
ARG APISIX_VERSION=2.9
78
LABEL apisix_version="${APISIX_VERSION}"

0 commit comments

Comments
 (0)