Copilot commented on code in PR #614:
URL: https://github.com/apache/apisix-docker/pull/614#discussion_r2915460239


##########
all-in-one/apisix-dashboard/Dockerfile:
##########
@@ -17,45 +17,36 @@
 
 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 update; \
+    apt-get -y install --no-install-recommends wget gnupg ca-certificates 
curl; \
+    codename=`grep -Po 'VERSION="[0-9]+ \(\K[^)]+' /etc/os-release`; \

Review Comment:
   `ENABLE_PROXY` is declared for this stage but no longer affects how Debian 
packages are fetched (unlike the previous Alpine build). If this build arg is 
still intended to support constrained networks, add an equivalent apt 
configuration (mirror/proxy) or remove the arg to avoid a misleading interface.



##########
all-in-one/apisix-dashboard/Dockerfile:
##########
@@ -17,45 +17,36 @@
 
 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 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 \

Review Comment:
   This stage uses `apt-key add`, which is deprecated in Debian/Ubuntu and can 
break on newer base images. Prefer installing the repo key into 
`/usr/share/keyrings/...` and referencing it via `deb [signed-by=...] ...` in 
the sources list entry.
   ```suggestion
           wget -O /usr/share/keyrings/apisix-archive-keyring.gpg 
https://repos.apiseven.com/pubkey.gpg \
           && echo "deb 
[signed-by=/usr/share/keyrings/apisix-archive-keyring.gpg] 
https://repos.apiseven.com/packages/debian $codename main" | tee 
/etc/apt/sources.list.d/apisix.list \
           ;; \
         arm64) \
           wget -O /usr/share/keyrings/apisix-archive-keyring.gpg 
https://repos.apiseven.com/pubkey.gpg \
           && echo "deb 
[signed-by=/usr/share/keyrings/apisix-archive-keyring.gpg] 
https://repos.apiseven.com/packages/arm64/debian $codename main" | tee 
/etc/apt/sources.list.d/apisix.list \
   ```



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