Skip to main content
Version: 3.20.0

Build Your Own Docker Images

You can build an APISIX image from the released Docker source and customize that source for your environment.

Prerequisite(s)​

  • Install Git to download the Docker source.
  • Install Docker to build and run the image.
  • Install Make to run the image build target.

Clone Repository​

Clone the release branch for this documentation version:

git clone --branch release/apisix-3.20.0 --depth 1 https://github.com/apache/apisix-docker.git
cd apisix-docker

Build a Docker Image​

Build an Ubuntu image with Make:

make build-on-ubuntu

Use make build-on-debian or make build-on-redhat to build one of the other supported images.

Check Docker Image​

Confirm that the built image contains the expected APISIX release:

docker run --rm --entrypoint apisix \
apache/apisix:3.20.0-ubuntu version

You should see the APISIX version:

3.20.0

Preserve the Container Entry Point​

Keep the release image's /docker-entrypoint.sh entrypoint and docker-start command when extending the image. The entrypoint initializes APISIX and then executes OpenResty with daemon off;, which keeps the gateway in the foreground as the container's final process.

Do not replace the container command with apisix start. That command returns after OpenResty starts in daemon mode, so a container whose final process is only apisix start exits even though the daemon was started.