apisix-docker is a free, open source api development & testing project written in Dockerfile and released under Apache-2.0. It has 871 GitHub stars, 498 forks and 5 open issues, and was last pushed 1 months ago. On this registry it ranks #151 of 187 tracked projects in API Development & Testing, with 5 head-to-head comparisons available. It gained 3 stars over the last 30 tracked days.

What is apisix-docker?

Apache APISIX Docker is the container packaging repository for Apache APISIX, a dynamic, real-time, high-performance API gateway, and it is aimed at developers, DevOps engineers and platform teams who want to run that gateway from the published apache/apisix image instead of building it from source.

What it is

Apache APISIX Docker is the Dockerfile and documentation repository behind the container image of Apache APISIX, a dynamic, real-time, high-performance API gateway. It lives in the cloud-native ecosystem, and its topics place it alongside Docker and Kubernetes work: api, api-gateway, api-management, apisix, cloud-native, devops, docker, kubernetes, loadbalancing, microservices, reverse-proxy and serverless. The image ships the gateway binary together with its default configuration, so an operator starts a working gateway by running a container, publishing ports and mounting a configuration file. The repository covers both configuration models: a stand-alone mode that reads configuration from apisix.yaml, and a traditional mode that uses etcd as the configuration center. It is licensed under Apache-2.0, and development direction is tracked in the upstream Apache APISIX projects roadmap.

The concrete problem is packaging and repeatable startup. Rather than compiling APISIX, installing it onto a host OS and wiring its configuration by hand, the container gives a fixed runtime where ports, volume mounts and environment variables describe the whole deployment. Inside that runtime, APISIX itself replaces the piecemeal traffic layer that teams usually assemble from several moving parts: it provides load balancing, dynamic upstream, canary release, circuit breaking, authentication and observability in one gateway, and it serves both traditional north-south traffic and east-west traffic between services.

Key capabilities

  • Stand-alone mode starts with the environment variable APISIX_STAND_ALONE=true, after which APISIX uses apisix.yaml as its configuration center and reloads that file on a regular schedule.
  • Traditional mode is configured through config.yaml, using deployment.role, role_traditional.config_provider set to etcd, etcd.host pointing at http://etcd:2379 and the etcd prefix /apisix.
  • The gateway listens on port 9080 by default, while the Admin API listens on 9180 and authenticates requests with the X-API-KEY header.
  • Configuration can be reloaded without downtime by running apisix reload inside the container.
  • Kubernetes Ingress is supported through the derived apisix-ingress-controller project.
  • Traffic management covers load balancing, dynamic upstream, canary release, circuit breaking, authentication and observability.
  • Every default option is documented in ./conf/config-default.yaml, and the container can be entered with a shell to edit ./conf/config.yaml before reloading.

Who uses it and how

  • Teams serving traditional north-south edge traffic that want the gateway running as a container rather than as a host installation.
  • Platform teams routing east-west traffic between microservices inside a shared cluster.
  • Kubernetes operators who deploy the apisix-ingress-controller alongside the gateway image.
  • Environments that avoid an external configuration database entirely by running stand-alone mode with apisix.yaml.
  • Organisations named in the README as users include NASA, Tencent Cloud, EU Digital Factory, Airbus, Airwallex and iQIYI.

Getting started

Start a stand-alone gateway with: docker run -d --name apache-apisix -p 9080:9080 -e APISIX_STAND_ALONE=true apache/apisix. For the etcd-backed variant, create an apisix-network, mount config.yaml into /usr/local/apisix/conf/config.yaml and publish both 9080 and 9180.

How it compares

The facts provide no list of paid products that this project replaces, and no competing gateway products are named. The only related project mentioned is apisix-ingress-controller, which is a derived companion component for Kubernetes rather than an alternative gateway. On the evidence available in this registry, Apache APISIX Docker stands alone in its category.

When to use it — and when not to

A self-hoster who skips stand-alone mode must operate an etcd cluster, keep config.yaml or apisix.yaml in step with the running gateway, manage the Admin API key and network setup, and understand that this repository is a packaging layer while gateway source and documentation live upstream at apisix.apache.org. Teams that want a fully managed gateway with no configuration files, or that cannot run containers, should not pick this. The README excerpt is also uneven: one published command snippet is truncated mid-block, so readers should confirm details against the upstream APISIX documentation before relying on it.

project readme (upstream, from github) — read inline

Roadmap

Refer to ⚡️ Apache APISIX Projects Roadmap

What is Apache APISIX API Gateway

Apache APISIX is a dynamic, real-time, high-performance API Gateway.

APISIX API Gateway provides rich traffic management features such as load balancing, dynamic upstream, canary release, circuit breaking, authentication, observability, and more.

You can use APISIX API Gateway to handle traditional north-south traffic, as well as east-west traffic between services. At present, APISIX has been used in various industries, including NASA, Tencent Cloud, EU Digital Factory, Airbus, Airwallex, iQIYI, etc.

How to run Apache APISIX

Apache APISIX supports stand-alone mode and also supports the use of etcd database as the configuration center.

How to run APISIX in stand-alone mode

In stand-alone mode, APISIX uses apisix.yaml as the configuration center to store routing, upstream, consumer and other information. After APISIX is started, it will load the apisix.yaml file regularly to update the corresponding configuration information.

You can start an APISIX container with stand-alone mode by the following command:

docker run -d --name apache-apisix \
  -p 9080:9080 \
  -e APISIX_STAND_ALONE=true \
  apache/apisix

Add Route and Plugin configuration to the running APISIX container:

docker exec -i apache-apisix sh -c 'cat > /usr/local/apisix/conf/apisix.yaml <<_EOC_
routes:
  -
    id: httpbin
    uri: /*
    upstream:
      nodes:
        "httpbin.org": 1
      type: roundrobin
    plugin_config_id: 1

plugin_configs:
  -
    id: 1
    plugins:
      response-rewrite:
        body: "Hello APISIX\n"
    desc: "response-rewrite"
#END
_EOC_'

Test example:

curl http://127.0.0.1:9080/
Hello APISIX

If you want to know more configuration examples, you can refer to stand-alone.

How to run APISIX using etcd as configuration center

Solution 1

The operation of APISIX also supports the use of etcd as the configuration center. Before starting the APISIX container, we need to start the etcd container with the following command, and specify the network used by the container as the host network. Make sure that all the required ports (default: 9080, 9443 and 2379) are available and not used by other system processes.

  1. Start etcd.
docker run -d \
  --name etcd \
  --net host \
  -e ALLOW_NONE_AUTHENTICATION=yes \
  -e ETCD_ADVERTISE_CLIENT_URLS=http://127.0.0.1:2379 \
  bitnamilegacy/etcd:3.5.11
  1. Start APISIX.
docker run -d \
  --name apache-apisix \
  --net host \
  apache/apisix
Solution 2

Before starting the APISIX container, we need to create a Docker virtual network and start the etcd container.

  1. Create a network and view the subnet address, then start etcd
docker network create apisix-network --driver bridge && \
docker network inspect -v apisix-network && \
docker run -d --name etcd \
  --network apisix-network \
  -p 2379:2379 \
  -p 2380:2380 \
  -e ALLOW_NONE_AUTHENTICATION=yes \
  -e ETCD_ADVERTISE_CLIENT_URLS=http://127.0.0.1:2379 \
  bitnamilegacy/etcd:3.5.11
  1. View the return result of the previous step, we can see the subnet address. Create a APISIX configuration file in the current directory. You need to set allow_admin to the subnet address obtained in step1.
cat << EOF > $(pwd)/config.yaml
deployment:
  role: traditional
  role_traditional:
    config_provider: etcd
  admin:
    allow_admin:
      - 0.0.0.0/0  # Please set it to the subnet address you obtained.
                  # If not set, by default all IP access is allowed.
  etcd:
    host:
      - "http://etcd:2379"
    prefix: "/apisix"
    timeout: 30
EOF
  1. Start APISIX and reference the file created in the previous step.
 docker run -d --name apache-apisix \
  --network apisix-network \
  -p 9080:9080 \
  -p 9180:9180 \
  -v $(pwd)/config.yaml:/usr/local/apisix/conf/config.yaml \
  apache/apisix
Test example

Check that APISIX is running properly by running the following command on the host.

curl "http://127.0.0.1:9180/apisix/admin/services/" \
-H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1'

The response indicates that apisix is running successfully:

{
  "total": 0,
  "list": []
}

If you want to modify the default configuration of APISIX, you can use the following command to enter the APISIX container and modify the configuration file ./conf/config.yaml, which will take effect after reloading APISIX. For details, please refer to ./conf/config-default.yaml.

docker exec -it apache-apisix bash

For more information, you can refer to the APISIX Website and APISIX Documentation. If you encounter problems during use, you can ask for help through slack and the mailing list.

Reload APISIX in a running container

If you change your custom configuration, you can reload APISIX (without downtime) by issuing.

docker exec -it apache-apisix apisix reload

This will run the apisix reload command in your container.

Kubernetes Ingress

During the deployment process, in addition to the above operations, APISIX also derived the apisix-ingress-controller, which can be deployed and used in the K8s environment more conveniently.

License

Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0

Frequently asked questions

Is apisix-docker free to use?

apisix-docker is open source under the Apache-2.0 licence. There is no licence fee and no seat count — you can self-host it or, where the project offers one, pay a vendor for a managed version instead.

What does apisix-docker do?

the docker for Apache APISIX

What is apisix-docker written in?

apisix-docker is primarily written in Dockerfile. Its source is publicly available at https://github.com/apache/apisix-docker, and it has 871 GitHub stars.