shreemaan-abhishek commented on code in PR #614:
URL: https://github.com/apache/apisix-docker/pull/614#discussion_r2909668578


##########
all-in-one/apisix-dashboard/Dockerfile:
##########
@@ -17,60 +17,56 @@
 
 ARG ENABLE_PROXY=false
 ARG ETCD_VERSION=v3.4.14
-ARG APISIX_VERSION=master
+ARG APISIX_VERSION=3.15.0
 ARG APISIX_DASHBOARD_VERSION=master
 
-# Build Apache APISIX
-FROM openresty/openresty:1.25.3.2-0-alpine-fat AS production-stage
+# Build Apache APISIX (using official package with apisix-nginx-module)
+FROM debian:bullseye-slim AS production-stage
 
 ARG APISIX_VERSION
 ARG ENABLE_PROXY
 LABEL apisix_version="${APISIX_VERSION}"
 
-RUN set -x \
-    && (test "${ENABLE_PROXY}" != "true" || /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 \
-    make \
-    clang \
-    wget \
-    git \
-    openldap-dev \
-    pcre2-dev \
-    sudo \
-    && wget 
https://github.com/yaml/libyaml/releases/download/0.2.5/yaml-0.2.5.tar.gz \
-    && tar -zxvf yaml-0.2.5.tar.gz \
-    && cd yaml-0.2.5 \
-    && ./configure --prefix=/usr \
-    && make \
-    && make install \
-    && ln -s /usr/lib/libyaml-0.so.2 /usr/local/lib/libyaml-0.so.2 \
-    && curl 
https://raw.githubusercontent.com/apache/apisix/master/utils/linux-install-luarocks.sh
 -sL | bash - \
-    && git config --global url.https://github.com/.insteadOf git://github.com/ 
\
-    && luarocks install 
https://raw.githubusercontent.com/apache/apisix/master/apisix-master-0.rockspec 
--tree=/usr/local/apisix/deps PCRE_DIR=/usr/local/openresty/pcre \
-    && cp -v 
/usr/local/apisix/deps/lib/luarocks/rocks-5.1/apisix/${APISIX_VERSION}-0/bin/apisix
 /usr/bin/ \
-    && (if [ "$APISIX_VERSION" = "master" ] || [ "$APISIX_VERSION" \> "2.2" ]; 
then echo 'use shell ';else bin='#! 
/usr/local/openresty/luajit/bin/luajit\npackage.path = 
"/usr/local/apisix/?.lua;" .. package.path'; sed -i "1s@.*@$bin@" 
/usr/bin/apisix ; fi;) \
-    && mv /usr/local/apisix/deps/share/lua/5.1/apisix /usr/local/apisix \
-    && apk del .builddeps build-base make unzip clang wget
+RUN set -ex; \
+    arch=$(dpkg --print-architecture); \
+    apt-get update; \
+    apt-get -y install --no-install-recommends wget gnupg ca-certificates 
curl; \
+    codename=$(grep -Po 'VERSION="[0-9]+ \(\K[^)]+' /etc/os-release); \
+    case "${arch}" in \
+      amd64) \
+        wget -O - https://repos.apiseven.com/pubkey.gpg | apt-key add - \
+        && echo "deb https://repos.apiseven.com/packages/debian $codename 
main" \
+           | tee /etc/apt/sources.list.d/apisix.list ;; \
+      arm64) \
+        wget -O - https://repos.apiseven.com/pubkey.gpg | apt-key add - \
+        && echo "deb https://repos.apiseven.com/packages/arm64/debian 
$codename main" \
+           | tee /etc/apt/sources.list.d/apisix.list ;; \
+    esac; \
+    apt-get update \
+    && apt-get install -y apisix=${APISIX_VERSION}-0 \
+    && apt-get purge -y --auto-remove wget gnupg \
+    && rm -rf /var/lib/apt/lists/* \
+    && openresty -V \
+    && apisix version
 
 # Build etcd
-FROM alpine:3.13 AS etcd-stage
+FROM debian:bullseye-slim AS etcd-stage
 
 ARG ETCD_VERSION
 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
+RUN set -ex; \
+    arch=$(dpkg --print-architecture); \
+    apt-get update \
+    && apt-get install -y --no-install-recommends wget ca-certificates \
+    && wget 
https://github.com/etcd-io/etcd/releases/download/${ETCD_VERSION}/etcd-${ETCD_VERSION}-linux-${arch}.tar.gz
 \
+    && tar -zxvf etcd-${ETCD_VERSION}-linux-${arch}.tar.gz \
+    && ln -s etcd-${ETCD_VERSION}-linux-${arch} etcd

Review Comment:
   why did we need to change this?



##########
all-in-one/apisix-dashboard/Dockerfile:
##########
@@ -111,32 +107,31 @@ RUN if [ "$ENABLE_PROXY" = "true" ] ; then yarn config 
set registry https://regi
     && yarn build
 
 # Finally combine all the resources into one image
-FROM alpine:3.13 AS last-stage
-
-ARG ENABLE_PROXY
+FROM debian:bullseye-slim AS last-stage

Review Comment:
   why change the base image here?



##########
all-in-one/apisix-dashboard/Dockerfile:
##########
@@ -17,60 +17,56 @@
 
 ARG ENABLE_PROXY=false
 ARG ETCD_VERSION=v3.4.14
-ARG APISIX_VERSION=master
+ARG APISIX_VERSION=3.15.0
 ARG APISIX_DASHBOARD_VERSION=master
 
-# Build Apache APISIX
-FROM openresty/openresty:1.25.3.2-0-alpine-fat AS production-stage
+# Build Apache APISIX (using official package with apisix-nginx-module)
+FROM debian:bullseye-slim AS production-stage
 
 ARG APISIX_VERSION
 ARG ENABLE_PROXY
 LABEL apisix_version="${APISIX_VERSION}"
 
-RUN set -x \
-    && (test "${ENABLE_PROXY}" != "true" || /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 \
-    make \
-    clang \
-    wget \
-    git \
-    openldap-dev \
-    pcre2-dev \
-    sudo \
-    && wget 
https://github.com/yaml/libyaml/releases/download/0.2.5/yaml-0.2.5.tar.gz \
-    && tar -zxvf yaml-0.2.5.tar.gz \
-    && cd yaml-0.2.5 \
-    && ./configure --prefix=/usr \
-    && make \
-    && make install \
-    && ln -s /usr/lib/libyaml-0.so.2 /usr/local/lib/libyaml-0.so.2 \
-    && curl 
https://raw.githubusercontent.com/apache/apisix/master/utils/linux-install-luarocks.sh
 -sL | bash - \
-    && git config --global url.https://github.com/.insteadOf git://github.com/ 
\
-    && luarocks install 
https://raw.githubusercontent.com/apache/apisix/master/apisix-master-0.rockspec 
--tree=/usr/local/apisix/deps PCRE_DIR=/usr/local/openresty/pcre \
-    && cp -v 
/usr/local/apisix/deps/lib/luarocks/rocks-5.1/apisix/${APISIX_VERSION}-0/bin/apisix
 /usr/bin/ \
-    && (if [ "$APISIX_VERSION" = "master" ] || [ "$APISIX_VERSION" \> "2.2" ]; 
then echo 'use shell ';else bin='#! 
/usr/local/openresty/luajit/bin/luajit\npackage.path = 
"/usr/local/apisix/?.lua;" .. package.path'; sed -i "1s@.*@$bin@" 
/usr/bin/apisix ; fi;) \
-    && mv /usr/local/apisix/deps/share/lua/5.1/apisix /usr/local/apisix \
-    && apk del .builddeps build-base make unzip clang wget
+RUN set -ex; \
+    arch=$(dpkg --print-architecture); \
+    apt-get update; \
+    apt-get -y install --no-install-recommends wget gnupg ca-certificates 
curl; \
+    codename=$(grep -Po 'VERSION="[0-9]+ \(\K[^)]+' /etc/os-release); \
+    case "${arch}" in \
+      amd64) \
+        wget -O - https://repos.apiseven.com/pubkey.gpg | apt-key add - \
+        && echo "deb https://repos.apiseven.com/packages/debian $codename 
main" \
+           | tee /etc/apt/sources.list.d/apisix.list ;; \
+      arm64) \
+        wget -O - https://repos.apiseven.com/pubkey.gpg | apt-key add - \
+        && echo "deb https://repos.apiseven.com/packages/arm64/debian 
$codename main" \
+           | tee /etc/apt/sources.list.d/apisix.list ;; \
+    esac; \
+    apt-get update \
+    && apt-get install -y apisix=${APISIX_VERSION}-0 \
+    && apt-get purge -y --auto-remove wget gnupg \
+    && rm -rf /var/lib/apt/lists/* \
+    && openresty -V \
+    && apisix version

Review Comment:
   this is similar to how other dockerfiles build APISIX right?



##########
all-in-one/apisix-dashboard/Dockerfile:
##########
@@ -17,60 +17,56 @@
 
 ARG ENABLE_PROXY=false
 ARG ETCD_VERSION=v3.4.14
-ARG APISIX_VERSION=master
+ARG APISIX_VERSION=3.15.0

Review Comment:
   I think we don't need to change this.



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to