@@ -28,88 +28,65 @@ iteration=0
2828# ## build apisix:
2929.PHONY : build-apisix-rpm
3030build-apisix-rpm :
31- mkdir -p ${PWD} /build/rpm
32- docker build -t apache/apisix:$(version ) --build-arg checkout_v=$(checkout ) -f ./dockerfiles/Dockerfile.apisix.rpm .
33- docker run -d --name dockerInstance --net=" host" apache/apisix:$(version )
34- docker cp dockerInstance:/tmp/build/output/ ${PWD} /build/rpm
35- docker system prune -a -f
31+ docker build -t apache/apisix:$(version ) --build-arg checkout_v=$(checkout ) \
32+ -f ./dockerfiles/Dockerfile.apisix.rpm .
3633
3734# ## build rpm for apisix:
3835.PHONY : package-apisix-rpm
3936package-apisix-rpm :
40- fpm -f -s dir -t rpm \
41- -n apisix \
42- -a ` uname -i` \
43- -v $(version ) \
44- --iteration $(iteration ) \
45- -d ' openresty >= 1.17.8.2' \
46- --description ' Apache APISIX is a distributed gateway for APIs and Microservices, focused on high performance and reliability.' \
47- --license " ASL 2.0" \
48- -C ${PWD} /build/rpm/output/apisix/ \
49- -p ${PWD} /output/ \
50- --url ' http://apisix.apache.org/' \
51- --config-files usr/lib/systemd/system/apisix.service
52- rm -rf ${PWD} /build
37+ docker build -t apache/apisix-packaged:$(version ) \
38+ --build-arg VERSION=$(version ) \
39+ --build-arg ITERATION=$(iteration ) \
40+ --build-arg PACKAGE_VERSION=$(version ) \
41+ -f ./dockerfiles/Dockerfile.package.apisix .
42+ docker run -d --rm --name output --net=" host" apache/apisix-packaged:$(version )
43+ docker cp output:/output ${PWD}
44+ docker stop output
45+ docker system prune -a -f
5346
5447# ## build dashboard:
5548.PHONY : build-dashboard-rpm
5649build-dashboard-rpm :
57- mkdir -p ${PWD} /build/rpm
58- docker build -t apache/apisix-dashboard:$(version ) --build-arg checkout_v=$(checkout ) -f ./dockerfiles/Dockerfile.dashboard.rpm .
59- docker run -d --name dockerInstance --net=" host" apache/apisix-dashboard:$(version )
60- docker cp dockerInstance:/tmp/build/output/ ${PWD} /build/rpm
61- docker system prune -a -f
50+ docker build -t apache/apisix-dashboard:$(version ) --build-arg checkout_v=$(checkout ) \
51+ -f ./dockerfiles/Dockerfile.dashboard.rpm .
6252
6353# ## build rpm for apisix dashboard:
6454.PHONY : package-dashboard-rpm
6555package-dashboard-rpm :
66- fpm -f -s dir -t rpm \
67- -n apisix-dashboard \
68- -a ` uname -i` \
69- -v $(version ) \
70- --iteration $(iteration ) \
71- --description ' Apache APISIX Dashboard is designed to make it as easy as possible for users to operate Apache APISIX through a frontend interface.' \
72- --license " ASL 2.0" \
73- -C ${PWD} /build/rpm/output/apisix/dashboard/ \
74- -p ${PWD} /output/ \
75- --url ' https://github.com/apache/apisix-dashboard'
76-
77- rm -rf ${PWD}/build
56+ docker build -t apache/apisix-dashboard-packaged:$(version ) \
57+ --build-arg VERSION=$(version ) \
58+ --build-arg ITERATION=$(iteration ) \
59+ --build-arg PACKAGE_VERSION=$(version ) \
60+ -f ./dockerfiles/Dockerfile.package.apisix-dashboard .
61+ docker run -d --rm --name output --net=" host" apache/apisix-dashboard-packaged:$(version )
62+ docker cp output:/output ${PWD} /output
63+ docker stop output
64+ docker system prune -a -f
7865
7966# ## build apisix-openresty:
8067.PHONY : build-apisix-openresty-rpm
8168build-apisix-openresty-rpm :
82- mkdir -p ${PWD} /build/rpm
8369 docker build -t apache/apisix-openresty:$(version ) --build-arg version=$(version ) \
8470 -f ./dockerfiles/Dockerfile.apisix-openresty.rpm .
85- docker run -d --name dockerInstance --net=" host" apache/apisix-openresty:$(version )
86- docker cp dockerInstance:/usr/local/openresty/ ${PWD} /build/rpm
87- docker system prune -a -f
8871
8972# ## build rpm for apisix-openresty:
9073.PHONY : package-apisix-openresty-rpm
9174package-apisix-openresty-rpm :
92- fpm -f -s dir -t rpm \
93- -n apisix-openresty \
94- -a ` uname -i` \
95- -v $(version ) \
96- --iteration $(iteration ) \
97- -x openresty/zlib \
98- -x openresty/openssl111 \
99- -x openresty/pcre \
100- -d ' openresty-zlib >= 1.2.11-3' \
101- -d ' openresty-openssl111 >= 1.1.1h-1' \
102- -d ' openresty-pcre >= 8.44-1' \
103- --post-install ${PWD} /post-install-apisix-openresty.sh \
104- --description " APISIX's OpenResty distribution." \
105- --license " ASL 2.0" \
106- -C ${PWD} /build/rpm \
107- -p ${PWD} /output/ \
108- --url ' http://apisix.apache.org/' \
109- --conflicts openresty \
110- --config-files usr/lib/systemd/system/openresty.service \
111- --prefix=/usr/local
112- rm -rf ${PWD} /build
75+ docker build -t apache/apisix-openresty-packaged:$(version ) \
76+ --build-arg VERSION=$(version ) \
77+ --build-arg ITERATION=$(iteration ) \
78+ --build-arg PACKAGE_VERSION=$(version ) \
79+ -f ./dockerfiles/Dockerfile.package.apisix-openresty .
80+ docker run -d --rm --name output --net=" host" apache/apisix-openresty-packaged:$(version )
81+ docker cp output:/output ${PWD}
82+ docker stop output
83+ docker system prune -a -f
84+
85+
86+ # ## build fpm for packaging:
87+ .PHONY : build-fpm
88+ build-fpm :
89+ docker build -t api7/fpm - < ./dockerfiles/Dockerfile.fpm
11390
11491ifeq ($(filter $(app ) ,apisix dashboard apisix-openresty) ,)
11592$(info the app's value have to be apisix or dashboard!)
@@ -121,17 +98,20 @@ else ifeq ($(version), 0)
12198$(info you have to input a version value!)
12299
123100else ifeq ($(app)_$(type),apisix-openresty_rpm)
101+ package : build-fpm
124102package : build-apisix-openresty-rpm
125103package : package-apisix-openresty-rpm
126104
127105else ifeq ($(checkout), 0)
128106$(info you have to input a checkout value!)
129107
130108else ifeq ($(app)_$(type),apisix_rpm)
109+ package : build-fpm
131110package : build-apisix-rpm
132111package : package-apisix-rpm
133112
134113else ifeq ($(app)_$(type),dashboard_rpm)
114+ package : build-fpm
135115package : build-dashboard-rpm
136116package : package-dashboard-rpm
137117
0 commit comments