You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2020/12/11 05:30:23 UTC

[GitHub] [apisix-docker] gxthrj commented on a change in pull request #99: feat: add dockerfile for apisix and dashboard with all dependencies

gxthrj commented on a change in pull request #99:
URL: https://github.com/apache/apisix-docker/pull/99#discussion_r540700820



##########
File path: all-in-one/apisix/Dockerfile
##########
@@ -0,0 +1,56 @@
+FROM openresty/openresty:alpine-fat AS production-stage
+
+ARG APISIX_VERSION=master
+LABEL apisix_version="${APISIX_VERSION}"
+
+
+RUN set -x \
+    && /bin/sed -i 's,http://dl-cdn.alpinelinux.org,https://mirrors.aliyun.com,g' /etc/apk/repositories \
+    && apk add --no-cache --virtual .builddeps \
+    automake \
+    autoconf \
+    libtool \
+    pkgconfig \
+    cmake \
+    git \
+    && luarocks install https://github.com/apache/apisix/raw/master/rockspec/apisix-${APISIX_VERSION}-0.rockspec --tree=/usr/local/apisix/deps \
+    && cp -v /usr/local/apisix/deps/lib/luarocks/rocks-5.1/apisix/${APISIX_VERSION}-0/bin/apisix /usr/bin/ \
+    && bin='#! /usr/local/openresty/luajit/bin/luajit\npackage.path = "/usr/local/apisix/?.lua;" .. package.path' \
+    && sed -i "1s@.*@$bin@" /usr/bin/apisix \
+    && mv /usr/local/apisix/deps/share/lua/5.1/apisix /usr/local/apisix \
+    && apk del .builddeps build-base make unzip
+
+FROM alpine:3.11 AS etcd-stage
+
+ARG ETCD_VERSION=v3.4.14
+LABEL etcd_version="${ETCD_VERSION}"
+
+WORKDIR /tmp
+
+RUN wget https://github.com/etcd-io/etcd/releases/download/${ETCD_VERSION}/etcd-${ETCD_VERSION}-linux-amd64.tar.gz \
+    && tar -zxvf etcd-${ETCD_VERSION}-linux-amd64.tar.gz \
+    && ln -s etcd-${ETCD_VERSION}-linux-amd64 etcd
+
+FROM alpine:3.11 AS last-stage
+
+# add runtime for Apache APISIX
+RUN set -x \
+    && /bin/sed -i 's,http://dl-cdn.alpinelinux.org,https://mirrors.aliyun.com,g' /etc/apk/repositories \
+    && apk add --no-cache bash libstdc++ curl
+
+WORKDIR /usr/local/apisix
+
+COPY --from=production-stage /usr/local/openresty/ /usr/local/openresty/
+COPY --from=production-stage /usr/local/apisix/ /usr/local/apisix/
+COPY --from=production-stage /usr/bin/apisix /usr/bin/apisix
+
+COPY --from=etcd-stage /tmp/etcd/etcd /usr/bin/etcd
+COPY --from=etcd-stage /tmp/etcd/etcdctl /usr/bin/etcdctl
+
+ENV PATH=$PATH:/usr/local/openresty/luajit/bin:/usr/local/openresty/nginx/sbin:/usr/local/openresty/bin
+
+EXPOSE 9080 9443 2379 2380
+
+CMD ["sh", "-c", "(nohup etcd >/tmp/etcd.log 2>&1 &) && sleep 10 && /usr/bin/apisix init && /usr/bin/apisix init_etcd && /usr/local/openresty/bin/openresty -p /usr/local/apisix -g 'daemon off;'"]
+
+STOPSIGNAL SIGQUIT

Review comment:
       done




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org