Build a custom Docker image

Uses: Kong Gateway
Related Documentation
Incompatible with
konnect
Tags
Minimum Version
Kong Gateway - 3.4
TL;DR

Create a Docker file and use docker build to build the image.

Prerequisites

  1. Download the Kong Gateway entry-point script:
     curl -O https://raw.githubusercontent.com/Kong/docker-kong/master/docker-entrypoint.sh
    
  2. Make the script executable:
     chmod +x docker-entrypoint.sh
    
  1. Download the image for your operating system.
  2. Rename the file to either kong.deb or kong.rpm depending on the package.

Create a Dockerfile

Create a Dockerfile using any of the following templates:

Build the image

Using the docker build command, you can build the image:

docker build --platform linux/amd64 --no-cache -t kong-image .

Docker will build the image according to the parameters set in the Dockerfile.

Validate the image

Validate that the image was built correctly using docker run:

docker run -it --rm kong-image kong version

If the image was built correctly, a Docker container will start and output the Kong Gateway Enterprise version to the console.

FAQs

You can use a custom image to specify certain settings, like custom ports or kong.conf parameters. This can be useful if your organization has certain requirements or other software that they use in conjunction with their API gateway. You can also use custom images in automation pipelines.

Something wrong?

Help us make these docs great!

Kong Developer docs are open source. If you find these useful and want to make them better, contribute today!