Skip to content

Commit 99a8a60

Browse files
authored
feat: readd built-in luarocks for apisix-base (#155)
1 parent 504cf4b commit 99a8a60

File tree

2 files changed

+14
-35
lines changed

2 files changed

+14
-35
lines changed

dockerfiles/Dockerfile.apisix-base.apk

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ RUN cd /tmp \
8989
&& curl --version \
9090
&& source /root/.cargo/env \
9191
&& ./build-common.sh build_apisix_base_apk \
92-
&& ./install-common.sh install_lua \
93-
&& ./install-common.sh install_luarocks \
92+
&& rm /usr/local/openresty/wasmtime-c-api/lib/libwasmtime.a \
93+
&& rm /usr/local/openresty/wasmtime-c-api/lib/libwasmtime.d \
9494
&& /usr/local/openresty/bin/openresty -V
9595

9696

@@ -104,8 +104,13 @@ RUN apk add --no-cache \
104104
libxslt \
105105
zlib \
106106
libstdc++ \
107-
&& rm /usr/local/openresty/wasmtime-c-api/lib/libwasmtime.a \
108-
&& rm /usr/local/openresty/wasmtime-c-api/lib/libwasmtime.d
107+
&& apk add --no-cache --virtual .build-deps \
108+
curl \
109+
make \
110+
sudo \
111+
&& curl https://raw.githubusercontent.com/apache/apisix/master/utils/linux-install-luarocks.sh -sL | sh - \
112+
&& apk del .build-deps
113+
109114

110115
ENV PATH=$PATH:/usr/local/openresty/luajit/bin:/usr/local/openresty/nginx/sbin:/usr/local/openresty/bin
111116

utils/install-common.sh

Lines changed: 5 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -16,29 +16,15 @@ install_apisix_dependencies_rpm() {
1616

1717
install_dependencies_rpm() {
1818
# install basic dependencies
19-
yum -y install wget tar gcc automake autoconf libtool make curl git which unzip
19+
yum -y install wget tar gcc automake autoconf libtool make curl git which unzip sudo
2020
yum -y install epel-release
2121
yum install -y yum-utils readline-dev readline-devel
22-
23-
# install lua 5.1 for compatible with openresty 1.17.8.2
24-
install_lua
2522
}
2623

2724
install_dependencies_deb() {
2825
# install basic dependencies
2926
DEBIAN_FRONTEND=noninteractive apt-get update
30-
DEBIAN_FRONTEND=noninteractive apt-get install -y wget tar gcc automake autoconf libtool make curl git unzip libreadline-dev lsb-release gawk
31-
32-
# install lua 5.1 for compatible with openresty 1.17.8.2
33-
install_lua
34-
}
35-
36-
install_lua() {
37-
wget http://www.lua.org/ftp/lua-5.1.4.tar.gz
38-
tar -zxvf lua-5.1.4.tar.gz
39-
cd lua-5.1.4/
40-
make linux
41-
make install
27+
DEBIAN_FRONTEND=noninteractive apt-get install -y wget tar gcc automake autoconf libtool make curl git unzip sudo libreadline-dev lsb-release gawk
4228
}
4329

4430
install_openresty_deb() {
@@ -59,18 +45,9 @@ install_openresty_rpm() {
5945
}
6046

6147
install_luarocks() {
62-
# install luarocks
63-
wget https://github.com/luarocks/luarocks/archive/v3.8.0.tar.gz
64-
tar -xf v3.8.0.tar.gz
65-
cd luarocks-3.8.0 || exit
66-
./configure --with-lua=/usr/local --with-lua-include=/usr/local/include >build.log 2>&1 || (cat build.log && exit 1)
67-
make build >build.log 2>&1 || (cat build.log && exit 1)
68-
make install >build.log 2>&1 || (cat build.log && exit 1)
69-
cd .. || exit
70-
rm -rf luarocks-3.8.0
71-
mkdir ~/.luarocks || true
72-
luarocks config variables.OPENSSL_LIBDIR /usr/local/openresty/openssl111/lib
73-
luarocks config variables.OPENSSL_INCDIR /usr/local/openresty/openssl111/include
48+
wget https://raw.githubusercontent.com/apache/apisix/master/utils/linux-install-luarocks.sh
49+
chmod +x linux-install-luarocks.sh
50+
./linux-install-luarocks.sh
7451
}
7552

7653
install_etcd() {
@@ -202,9 +179,6 @@ install_dashboard_dependencies_deb)
202179
install_dashboard)
203180
install_dashboard
204181
;;
205-
install_lua)
206-
install_lua
207-
;;
208182
install_luarocks)
209183
install_luarocks
210184
;;

0 commit comments

Comments
 (0)