File tree Expand file tree Collapse file tree 1 file changed +38
-0
lines changed
Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Original file line number Diff line number Diff line change 1+ FROM openresty/openresty:alpine-fat AS production-stage
2+
3+ RUN set -x \
4+ && /bin/sed -i 's,http://dl-cdn.alpinelinux.org,https://mirrors.aliyun.com,g' /etc/apk/repositories \
5+ && apk add --no-cache --virtual .builddeps \
6+ automake \
7+ autoconf \
8+ libtool \
9+ pkgconfig \
10+ cmake \
11+ git \
12+ && luarocks install https://github.com/apache/incubator-apisix/raw/master/rockspec/apisix-master-0.rockspec --tree=/usr/local/apisix/deps \
13+ && cp -v /usr/local/apisix/deps/lib/luarocks/rocks-5.1/apisix/master-0/bin/apisix /usr/bin/ \
14+ && bin='#! /usr/local/openresty/luajit/bin/luajit\n package.path = "/usr/local/apisix/?.lua;" .. package.path' \
15+ && sed -i "1s@.*@$bin@" /usr/bin/apisix \
16+ && mv /usr/local/apisix/deps/share/lua/5.1/apisix /usr/local/apisix \
17+ && apk del .builddeps build-base make unzip
18+
19+ FROM alpine:3.11 AS last-stage
20+
21+ # add runtime for Apache APISIX
22+ RUN set -x \
23+ && /bin/sed -i 's,http://dl-cdn.alpinelinux.org,https://mirrors.aliyun.com,g' /etc/apk/repositories \
24+ && apk add --no-cache bash libstdc++ curl
25+
26+ WORKDIR /usr/local/apisix
27+
28+ COPY --from=production-stage /usr/local/openresty/ /usr/local/openresty/
29+ COPY --from=production-stage /usr/local/apisix/ /usr/local/apisix/
30+ COPY --from=production-stage /usr/bin/apisix /usr/bin/apisix
31+
32+ ENV PATH=$PATH:/usr/local/openresty/luajit/bin:/usr/local/openresty/nginx/sbin:/usr/local/openresty/bin
33+
34+ EXPOSE 9080 9443
35+
36+ CMD ["sh" , "-c" , "/usr/bin/apisix init && /usr/bin/apisix init_etcd && /usr/local/openresty/bin/openresty -p /usr/local/apisix -g 'daemon off;'" ]
37+
38+ STOPSIGNAL SIGQUIT
You can’t perform that action at this time.
0 commit comments