This is an automated email from the ASF dual-hosted git repository.
spacewander 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 0e8dcce fix: example unavailable (#366)
0e8dcce is described below
commit 0e8dcce6a27578c628971160a8be23dcc7b4a691
Author: soulbird <[email protected]>
AuthorDate: Thu Sep 29 09:04:28 2022 +0800
fix: example unavailable (#366)
Co-authored-by: soulbird <[email protected]>
---
.github/workflows/apisix-docker-example-test.yaml | 2 +-
.github/workflows/apisix_all_in_one_ci.yaml | 6 +--
.github/workflows/apisix_push_docker_hub.yaml | 2 +-
all-in-one/apisix/Dockerfile | 51 ++---------------------
all-in-one/apisix/config.yaml | 11 ++++-
alpine-dev/Dockerfile | 4 +-
alpine/Dockerfile | 2 +-
compose/apisix_conf/release/config.yaml | 24 ++++++-----
compose/docker-compose-release.yaml | 1 +
example/apisix_conf/config.yaml | 36 ++++++++--------
example/docker-compose-arm64.yml | 1 +
example/docker-compose.yml | 1 +
12 files changed, 56 insertions(+), 85 deletions(-)
diff --git a/.github/workflows/apisix-docker-example-test.yaml
b/.github/workflows/apisix-docker-example-test.yaml
index a69d61a..082fd89 100644
--- a/.github/workflows/apisix-docker-example-test.yaml
+++ b/.github/workflows/apisix-docker-example-test.yaml
@@ -26,7 +26,7 @@ jobs:
sleep 30
grep -C 3 '\[error\]' example/apisix_log/error.log && exit 1
- curl http://127.0.0.1:9080/apisix/admin/routes/1 \
+ curl http://127.0.0.1:9180/apisix/admin/routes/1 \
-H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
{
"uri": "/get",
diff --git a/.github/workflows/apisix_all_in_one_ci.yaml
b/.github/workflows/apisix_all_in_one_ci.yaml
index 5d24c6d..ba3960a 100644
--- a/.github/workflows/apisix_all_in_one_ci.yaml
+++ b/.github/workflows/apisix_all_in_one_ci.yaml
@@ -12,11 +12,11 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v2
+ - uses: actions/checkout@v3
- name: Build and Test
run: |
docker build -t apache/apisix:whole -f
./all-in-one/apisix/Dockerfile .
- docker run -v
`pwd`/all-in-one/apisix/config.yaml:/usr/local/apisix/conf/config.yaml -p
9080:9080 -p 2379:2379 --name apisix -d apache/apisix:whole
+ docker run -v
`pwd`/all-in-one/apisix/config.yaml:/usr/local/apisix/conf/config.yaml -p
9180:9180 -p 9080:9080 -p 2379:2379 --name apisix -d apache/apisix:whole
sleep 30
- curl http://127.0.0.1:9080/apisix/admin/schema/service -H
'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1'
+ curl http://127.0.0.1:9180/apisix/admin/schema/service -H
'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1'
diff --git a/.github/workflows/apisix_push_docker_hub.yaml
b/.github/workflows/apisix_push_docker_hub.yaml
index e2888e0..8d307f7 100644
--- a/.github/workflows/apisix_push_docker_hub.yaml
+++ b/.github/workflows/apisix_push_docker_hub.yaml
@@ -30,7 +30,7 @@ jobs:
run: |
grep -C 3 '\[error\]' compose/apisix_log/error.log && exit 1
- curl http://127.0.0.1:9080/apisix/admin/routes/1 \
+ curl http://127.0.0.1:9180/apisix/admin/routes/1 \
-H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
{
"uri": "/get",
diff --git a/all-in-one/apisix/Dockerfile b/all-in-one/apisix/Dockerfile
index bee55a3..2e9e22e 100644
--- a/all-in-one/apisix/Dockerfile
+++ b/all-in-one/apisix/Dockerfile
@@ -17,39 +17,11 @@
ARG ENABLE_PROXY=false
ARG APISIX_VERSION=2.99.0
-ARG ETCD_VERSION=v3.4.14
+ARG ETCD_VERSION=v3.5.4
# Build Apache APISIX
-FROM api7/apisix-base:1.21.4.1.1 AS production-stage
+FROM apache/apisix:${APISIX_VERSION}-debian
-ARG APISIX_VERSION
-LABEL apisix_version="${APISIX_VERSION}"
-
-ARG ENABLE_PROXY
-
-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 \
- build-base \
- automake \
- autoconf \
- libtool \
- pkgconfig \
- cmake \
- unzip \
- curl \
- openssl \
- git \
- openldap-dev \
- && git config --global url.https://github.com/.insteadOf git://github.com/
\
- && luarocks install
https://github.com/apache/apisix/raw/master/rockspec/apisix-${APISIX_VERSION}-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/ \
- && (function ver_lt { [ "$1" = "$2" ] && return 1 || [ "$1" = "`echo -e
"$1\n$2" | sort -V | head -n1`" ]; }; if [ "$APISIX_VERSION" = "master" ] ||
ver_lt 2.2.0 $APISIX_VERSION; 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
-
-# Build etcd
-FROM alpine:3.13 AS etcd-stage
ARG ETCD_VERSION
LABEL etcd_version="${ETCD_VERSION}"
@@ -58,29 +30,14 @@ 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
+ && mv etcd-${ETCD_VERSION}-linux-amd64/* /usr/bin/
-# Finally combine all the resources into one image
-FROM alpine:3.13 AS last-stage
-
-ARG ENABLE_PROXY
-# 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 openldap-dev
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
+EXPOSE 9180 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;'"]
diff --git a/all-in-one/apisix/config.yaml b/all-in-one/apisix/config.yaml
index 6b0d577..55caf92 100644
--- a/all-in-one/apisix/config.yaml
+++ b/all-in-one/apisix/config.yaml
@@ -19,8 +19,15 @@ apisix:
node_listen: 9080 # APISIX listening port
enable_ipv6: false
- allow_admin: #
http://nginx.org/en/docs/http/ngx_http_access_module.html#allow
- - 0.0.0.0/0 # We need to restrict ip access rules for
security. 0.0.0.0/0 is for test.
+deployment:
+ admin:
+ allow_admin: #
http://nginx.org/en/docs/http/ngx_http_access_module.html#allow
+ - 0.0.0.0/0 # We need to restrict ip access rules for
security. 0.0.0.0/0 is for test.
+
+ admin_key:
+ - name: "admin"
+ key: edd1c9f034335f136f87ad84b625c8f1
+ role: admin # admin: manage all configuration data
plugin_attr:
prometheus:
diff --git a/alpine-dev/Dockerfile b/alpine-dev/Dockerfile
index b882e68..7748939 100644
--- a/alpine-dev/Dockerfile
+++ b/alpine-dev/Dockerfile
@@ -17,7 +17,7 @@
ARG ENABLE_PROXY=false
-FROM api7/apisix-base:1.21.4.1.1 AS production-stage
+FROM api7/apisix-base:1.21.4.1.2 AS production-stage
ARG ENABLE_PROXY
RUN set -x \
@@ -53,7 +53,7 @@ WORKDIR /usr/local/apisix
ENV
PATH=$PATH:/usr/local/openresty/luajit/bin:/usr/local/openresty/nginx/sbin:/usr/local/openresty/bin
-EXPOSE 9080 9443
+EXPOSE 9180 9080 9443
CMD ["sh", "-c", "/usr/bin/apisix init && /usr/bin/apisix init_etcd &&
/usr/local/openresty/bin/openresty -p /usr/local/apisix -g 'daemon off;'"]
diff --git a/alpine/Dockerfile b/alpine/Dockerfile
index bb6c28a..6c38599 100644
--- a/alpine/Dockerfile
+++ b/alpine/Dockerfile
@@ -58,7 +58,7 @@ WORKDIR /usr/local/apisix
ENV
PATH=$PATH:/usr/local/openresty/luajit/bin:/usr/local/openresty/nginx/sbin:/usr/local/openresty/bin
-EXPOSE 9080 9443
+EXPOSE 9180 9080 9443
CMD ["sh", "-c", "/usr/bin/apisix init && /usr/bin/apisix init_etcd &&
/usr/local/openresty/bin/openresty -p /usr/local/apisix -g 'daemon off;'"]
diff --git a/compose/apisix_conf/release/config.yaml
b/compose/apisix_conf/release/config.yaml
index c302dc0..7ddb27d 100644
--- a/compose/apisix_conf/release/config.yaml
+++ b/compose/apisix_conf/release/config.yaml
@@ -19,16 +19,18 @@ apisix:
node_listen: 9080 # APISIX listening port
enable_ipv6: false
- allow_admin: #
http://nginx.org/en/docs/http/ngx_http_access_module.html#allow
- - 0.0.0.0/0 # We need to restrict ip access rules for
security. 0.0.0.0/0 is for test.
+deployment:
+ admin:
+ allow_admin: #
http://nginx.org/en/docs/http/ngx_http_access_module.html#allow
+ - 0.0.0.0/0 # We need to restrict ip access rules for
security. 0.0.0.0/0 is for test.
- admin_key:
- - name: "admin"
- key: edd1c9f034335f136f87ad84b625c8f1
- role: admin # admin: manage all configuration data
+ admin_key:
+ - name: "admin"
+ key: edd1c9f034335f136f87ad84b625c8f1
+ role: admin # admin: manage all configuration data
-etcd:
- host: # it's possible to define multiple etcd
hosts addresses of the same etcd cluster.
- - "http://etcd:2379" # multiple etcd address
- prefix: "/apisix" # apisix configurations prefix
- timeout: 30 # 30 seconds
+ etcd:
+ host: # it's possible to define multiple etcd
hosts addresses of the same etcd cluster.
+ - "http://etcd:2379" # multiple etcd address
+ prefix: "/apisix" # apisix configurations prefix
+ timeout: 30 # 30 seconds
diff --git a/compose/docker-compose-release.yaml
b/compose/docker-compose-release.yaml
index d354d3a..e85c64e 100644
--- a/compose/docker-compose-release.yaml
+++ b/compose/docker-compose-release.yaml
@@ -27,6 +27,7 @@ services:
depends_on:
- etcd
ports:
+ - "9180:9180/tcp"
- "9080:9080/tcp"
- "9091:9091/tcp"
- "9443:9443/tcp"
diff --git a/example/apisix_conf/config.yaml b/example/apisix_conf/config.yaml
index 19b169b..cf4095f 100644
--- a/example/apisix_conf/config.yaml
+++ b/example/apisix_conf/config.yaml
@@ -19,28 +19,30 @@ apisix:
node_listen: 9080 # APISIX listening port
enable_ipv6: false
- allow_admin: #
http://nginx.org/en/docs/http/ngx_http_access_module.html#allow
- - 0.0.0.0/0 # We need to restrict ip access rules for
security. 0.0.0.0/0 is for test.
-
- admin_key:
- - name: "admin"
- key: edd1c9f034335f136f87ad84b625c8f1
- role: admin # admin: manage all configuration data
- # viewer: only can view configuration data
- - name: "viewer"
- key: 4054f7cf07e344346cd3f287985e76a2
- role: viewer
-
enable_control: true
control:
ip: "0.0.0.0"
port: 9092
-etcd:
- host: # it's possible to define multiple etcd
hosts addresses of the same etcd cluster.
- - "http://etcd:2379" # multiple etcd address
- prefix: "/apisix" # apisix configurations prefix
- timeout: 30 # 30 seconds
+deployment:
+ admin:
+ allow_admin: #
http://nginx.org/en/docs/http/ngx_http_access_module.html#allow
+ - 0.0.0.0/0 # We need to restrict ip access rules for
security. 0.0.0.0/0 is for test.
+
+ admin_key:
+ - name: "admin"
+ key: edd1c9f034335f136f87ad84b625c8f1
+ role: admin # admin: manage all configuration data
+
+ - name: "viewer"
+ key: 4054f7cf07e344346cd3f287985e76a2
+ role: viewer
+
+ etcd:
+ host: # it's possible to define multiple etcd
hosts addresses of the same etcd cluster.
+ - "http://etcd:2379" # multiple etcd address
+ prefix: "/apisix" # apisix configurations prefix
+ timeout: 30 # 30 seconds
plugin_attr:
prometheus:
diff --git a/example/docker-compose-arm64.yml b/example/docker-compose-arm64.yml
index 56a5662..d96be72 100644
--- a/example/docker-compose-arm64.yml
+++ b/example/docker-compose-arm64.yml
@@ -37,6 +37,7 @@ services:
depends_on:
- etcd
ports:
+ - "9180:9180/tcp"
- "9080:9080/tcp"
- "9091:9091/tcp"
- "9443:9443/tcp"
diff --git a/example/docker-compose.yml b/example/docker-compose.yml
index 5a113de..93581c6 100644
--- a/example/docker-compose.yml
+++ b/example/docker-compose.yml
@@ -38,6 +38,7 @@ services:
- etcd
##network_mode: host
ports:
+ - "9180:9180/tcp"
- "9080:9080/tcp"
- "9091:9091/tcp"
- "9443:9443/tcp"