This is an automated email from the ASF dual-hosted git repository.
shreemaanabhishek pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix-docker.git
The following commit(s) were added to refs/heads/master by this push:
new 585c12d chore: remove check_standalone_config.sh in favor of
Lua-based validation (#614)
585c12d is described below
commit 585c12dbfe9007f46cb98c2ea5b6f5fe9ae4ecce
Author: Mohammad Izzraff Janius
<[email protected]>
AuthorDate: Thu Mar 12 16:42:33 2026 +0800
chore: remove check_standalone_config.sh in favor of Lua-based validation
(#614)
---
Makefile | 4 --
all-in-one/apisix-dashboard/Dockerfile | 82 +++++++++++++++-------------------
debian-dev/Dockerfile | 1 -
debian-dev/Dockerfile.local | 1 -
debian-dev/docker-entrypoint.sh | 3 --
debian/Dockerfile | 1 -
redhat/Dockerfile | 1 -
redhat/docker-entrypoint.sh | 3 --
ubuntu/Dockerfile | 1 -
utils/check_standalone_config.sh | 17 -------
utils/docker-entrypoint.sh | 3 --
11 files changed, 35 insertions(+), 82 deletions(-)
diff --git a/Makefile b/Makefile
index d9a653c..517ca32 100644
--- a/Makefile
+++ b/Makefile
@@ -75,9 +75,7 @@ endef
.PHONY: build-on-redhat
build-on-redhat:
@$(call func_echo_status, "$@ -> [ Start ]")
- cp ./utils/check_standalone_config.sh redhat/check_standalone_config.sh
$(ENV_DOCKER) build -t $(ENV_APISIX_IMAGE_TAG_NAME)-redhat -f
./redhat/Dockerfile redhat
- rm -f redhat/check_standalone_config.sh
@$(call func_echo_success_status, "$@ -> [ Done ]")
### build-on-debian-dev : Build apache/apisix:xx-debian-dev image
@@ -166,12 +164,10 @@ push-multiarch-on-debian:
.PHONY: push-multiarch-on-redhat
push-multiarch-on-redhat:
@$(call func_echo_status, "$@ -> [ Start ]")
- cp ./utils/check_standalone_config.sh redhat/check_standalone_config.sh
$(ENV_DOCKER) buildx build --network=host --push \
-t $(ENV_APISIX_IMAGE_TAG_NAME)-redhat \
--platform linux/amd64,linux/arm64 \
-f ./redhat/Dockerfile redhat
- rm -f redhat/check_standalone_config.sh
@$(call func_echo_success_status, "$@ -> [ Done ]")
### push-multiarch-on-latest : Push apache/apisix:latest image
diff --git a/all-in-one/apisix-dashboard/Dockerfile
b/all-in-one/apisix-dashboard/Dockerfile
index b00e627..6d7590f 100644
--- a/all-in-one/apisix-dashboard/Dockerfile
+++ b/all-in-one/apisix-dashboard/Dockerfile
@@ -17,45 +17,35 @@
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 \
+ ;; \
+ esac; \
+ apt update \
+ && apt install -y apisix=${APISIX_VERSION}-0 \
+ && apt-get purge -y --auto-remove \
+ && openresty -V \
+ && apisix version
# Build etcd
FROM alpine:3.13 AS etcd-stage
@@ -70,7 +60,7 @@ RUN wget
https://github.com/etcd-io/etcd/releases/download/${ETCD_VERSION}/etcd-
# Build APISIX Dashboard - 1. download source code from github
-FROM alpine:latest as pre-build
+FROM alpine:latest AS pre-build
ARG APISIX_DASHBOARD_TAG
@@ -80,7 +70,7 @@ RUN set -x \
&& tar -xvf /tmp/apisix-dashboard.tar.gz -C /usr/local/apisix-dashboard
--strip 1
# Build APISIX Dashboard - 2. build manager-api from source code
-FROM golang:1.17 as api-builder
+FROM golang:1.17 AS api-builder
ARG APISIX_DASHBOARD_VERSION
ARG ENABLE_PROXY
@@ -94,7 +84,7 @@ RUN if [ "$ENABLE_PROXY" = "true" ] ; then go env -w
GOPROXY=https://goproxy.io,
&& CGO_ENABLED=0 ./api/build.sh
# Build APISIX Dashboard - 3. build dashboard web-UI from source code
-FROM node:14-alpine as fe-builder
+FROM node:14-alpine AS fe-builder
ARG ENABLE_PROXY
@@ -111,21 +101,23 @@ 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
# add runtime for Apache APISIX
-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 bash libstdc++ curl
+RUN apt update \
+ && apt install -y --no-install-recommends \
+ bash \
+ curl \
+ ca-certificates \
+ libyaml-0-2 \
+ lua5.1 \
+ && rm -rf /var/lib/apt/lists/*
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=production-stage /usr/lib/libyaml* /usr/lib/
COPY --from=etcd-stage /tmp/etcd/etcd /usr/bin/etcd
COPY --from=etcd-stage /tmp/etcd/etcdctl /usr/bin/etcdctl
@@ -133,10 +125,6 @@ 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
# dashboard
-
-RUN if [ "$ENABLE_PROXY" = "true" ] ; then sed -i
's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories ; fi \
- && apk add lua5.1
-
WORKDIR /usr/local/apisix-dashboard
COPY --from=api-builder /usr/local/apisix-dashboard/output/ ./
diff --git a/debian-dev/Dockerfile b/debian-dev/Dockerfile
index 437eae4..adb0e8e 100644
--- a/debian-dev/Dockerfile
+++ b/debian-dev/Dockerfile
@@ -70,7 +70,6 @@ ENV
PATH=$PATH:/usr/local/openresty/luajit/bin:/usr/local/openresty/nginx/sbin:/
EXPOSE 9080 9443
COPY ./docker-entrypoint.sh /docker-entrypoint.sh
-COPY ./check_standalone_config.sh /check_standalone_config.sh
ENTRYPOINT ["/docker-entrypoint.sh"]
diff --git a/debian-dev/Dockerfile.local b/debian-dev/Dockerfile.local
index caef2f2..c920946 100644
--- a/debian-dev/Dockerfile.local
+++ b/debian-dev/Dockerfile.local
@@ -66,7 +66,6 @@ RUN ln -sf /dev/stdout /usr/local/apisix/logs/access.log \
EXPOSE 9080 9443
COPY ${ENTRYPOINT_PATH} /docker-entrypoint.sh
-COPY ../utils/check_standalone_config.sh /check_standalone_config.sh
ENTRYPOINT ["/docker-entrypoint.sh"]
diff --git a/debian-dev/docker-entrypoint.sh b/debian-dev/docker-entrypoint.sh
index b130a97..c12dcee 100755
--- a/debian-dev/docker-entrypoint.sh
+++ b/debian-dev/docker-entrypoint.sh
@@ -30,9 +30,6 @@ deployment:
role_data_plane:
config_provider: yaml
_EOC_
- else
- # Check if the deployment role is set to data_plane and config
provider is set to yaml for standalone mode
- source /check_standalone_config.sh
fi
if [ ! -f "${PREFIX}/conf/apisix.yaml" ]; then
diff --git a/debian/Dockerfile b/debian/Dockerfile
index b124903..f624ec5 100644
--- a/debian/Dockerfile
+++ b/debian/Dockerfile
@@ -64,7 +64,6 @@ RUN ln -sf /dev/stdout /usr/local/apisix/logs/access.log \
EXPOSE 9080 9443
COPY ./docker-entrypoint.sh /docker-entrypoint.sh
-COPY ./check_standalone_config.sh /check_standalone_config.sh
ENTRYPOINT ["/docker-entrypoint.sh"]
diff --git a/redhat/Dockerfile b/redhat/Dockerfile
index ab3213b..7ef439b 100644
--- a/redhat/Dockerfile
+++ b/redhat/Dockerfile
@@ -43,7 +43,6 @@ RUN ln -sf /dev/stdout /usr/local/apisix/logs/access.log \
EXPOSE 9080 9443
COPY ./docker-entrypoint.sh /docker-entrypoint.sh
-COPY ./check_standalone_config.sh /check_standalone_config.sh
ENTRYPOINT ["/docker-entrypoint.sh"]
diff --git a/redhat/docker-entrypoint.sh b/redhat/docker-entrypoint.sh
index b3663f0..3f356e1 100755
--- a/redhat/docker-entrypoint.sh
+++ b/redhat/docker-entrypoint.sh
@@ -30,9 +30,6 @@ deployment:
role_data_plane:
config_provider: yaml
_EOC_
- else
- # Check if the deployment role is set to data_plane and config
provider is set to yaml for standalone mode
- source /check_standalone_config.sh
fi
if [ ! -f "${PREFIX}/conf/apisix.yaml" ]; then
diff --git a/ubuntu/Dockerfile b/ubuntu/Dockerfile
index 2cc911d..98cc717 100644
--- a/ubuntu/Dockerfile
+++ b/ubuntu/Dockerfile
@@ -64,7 +64,6 @@ RUN ln -sf /dev/stdout /usr/local/apisix/logs/access.log \
EXPOSE 9080 9443
COPY ./docker-entrypoint.sh /docker-entrypoint.sh
-COPY ./check_standalone_config.sh /check_standalone_config.sh
ENTRYPOINT ["/docker-entrypoint.sh"]
diff --git a/utils/check_standalone_config.sh b/utils/check_standalone_config.sh
deleted file mode 100644
index 385a366..0000000
--- a/utils/check_standalone_config.sh
+++ /dev/null
@@ -1,17 +0,0 @@
-if ! grep -q 'role: data_plane' "${PREFIX}/conf/config.yaml"; then
- echo "Error: ${PREFIX}/conf/config.yaml does not contain 'role:
data_plane'. Deployment role must be set to 'data_plane' for standalone mode."
- echo "Please refer to the APISIX documentation for deployment modes:
https://apisix.apache.org/docs/apisix/deployment-modes/"
- exit 1
-fi
-
-if ! grep -q 'role_data_plane:' "${PREFIX}/conf/config.yaml"; then
- echo "Error: ${PREFIX}/conf/config.yaml does not contain
'role_data_plane:'."
- echo "Please refer to the APISIX documentation for deployment modes:
https://apisix.apache.org/docs/apisix/deployment-modes/"
- exit 1
-fi
-
-if ! grep -q 'config_provider: yaml' "${PREFIX}/conf/config.yaml"; then
- echo "Error: ${PREFIX}/conf/config.yaml does not contain 'config_provider:
yaml'. Config provider must be set to 'yaml' for standalone mode."
- echo "Please refer to the APISIX documentation for deployment modes:
https://apisix.apache.org/docs/apisix/deployment-modes/"
- exit 1
-fi
diff --git a/utils/docker-entrypoint.sh b/utils/docker-entrypoint.sh
index b3663f0..3f356e1 100755
--- a/utils/docker-entrypoint.sh
+++ b/utils/docker-entrypoint.sh
@@ -30,9 +30,6 @@ deployment:
role_data_plane:
config_provider: yaml
_EOC_
- else
- # Check if the deployment role is set to data_plane and config
provider is set to yaml for standalone mode
- source /check_standalone_config.sh
fi
if [ ! -f "${PREFIX}/conf/apisix.yaml" ]; then