Deploy as a Docker Image
Using Additional Roots of Trust
If necessary, we can configure an additional Certificate Authority.
To do so:
- Mount the ca bundle into the container by including the following flag in the docker run command
-v /path/to/ca.crt:/destination/of/ca.crt
- Set env variable
KONG_NGINX_PROXY_PROXY_SSL_TRUSTED_CERTIFICATEto path with ca cert by including the following flag in the docker run command
-e "KONG_NGINX_PROXY_PROXY_SSL_TRUSTED_CERTIFICATE=/destination/of/ca.crt"
Running in Docker
Below is a simple example of adding the Corsha Plugin to Kong running in Docker in db-less mode locally. Notice that the /tmp/kong.yml, /tmp/kong.conf, /tmp/corsha-kong-plugin is mounted into the Kong container.
docker run -d --name kong-ee --network=kong-net \
-e "KONG_PROXY_ACCESS_LOG=/dev/stdout" \
-e "KONG_ADMIN_ACCESS_LOG=/dev/stdout" \
-e "KONG_PROXY_ERROR_LOG=/dev/stderr" \
-e "KONG_ADMIN_ERROR_LOG=/dev/stderr" \
-e "KONG_ADMIN_LISTEN=0.0.0.0:8001" \
-e "KONG_DATABASE=off" \
-e "KONG_DECLARATIVE_CONFIG=/usr/local/kong/declarative/kong.yml" \
-e "KONG_ADMIN_GUI_URL=http://localhost:8002" \
-v /tmp/kong.yml:/usr/local/kong/declarative/kong.yml \
-v /tmp/kong.conf:/etc/kong/kong.conf \
-v /tmp/corsha-kong-plugin:/usr/local/bin/corsha-kong-plugin \
-p 8000:8000 \
-p 8443:8443 \
-p 8001:8001 \
-p 8444:8444 \
-p 8002:8002 \
-p 8445:8445 \
-p 8003:8003 \
-p 8004:8004 \
kong/kong-gateway:2.4.1.0-alpine
Next we'll make a request with a Corsha Cred through Kong + Corsha. You will need to outfit your API clients with Corsha Authenticators using the guide to Adding an Authenticator to API Clients.