Today i want to explain how to install Kong Api Gateway on your Windows Docker Desktop.

This is the official guide but there are some error ( https://hub.docker.com/_/kong )

I have used PostreSQL. In the official guide there is not a “Password” for database and so it do error.

Open a command line and insert this three command.

On your docker desktop client than you must to see the 2 container for database and api gateway.

1. Link Kong to either a Cassandra or PostgreSQL container

docker run -d --name kong-database ^
                -p 5432:5432 ^
                -e "POSTGRES_USER=kong" ^
                -e "POSTGRES_DB=kong" ^
		-e "POSTGRES_PASSWORD=kong" ^
                postgres:9.6

2. Prepare your database

docker run --rm ^
    --link kong-database:kong-database ^
    -e "KONG_DATABASE=postgres" ^
    -e "KONG_PG_HOST=kong-database" ^
    -e "KONG_PG_PASSWORD=kong" ^
    kong kong migrations bootstrap
docker run -d --name kong ^
    --link kong-database:kong-database ^
    -e "KONG_DATABASE=postgres" ^
    -e "KONG_PG_HOST=kong-database" ^
    -e "KONG_PG_PASSWORD=kong" ^
    -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, 0.0.0.0:8444 ssl" ^
    -p 8000:8000 ^
    -p 8443:8443 ^
    -p 8001:8001 ^
    -p 8444:8444 ^
    kong

Have fun!

Tags:

2 Comments

  1. It is not working
    docker run –rm –network=kong-net -e “KONG_DATABASE=postgres” -e “KONG_PG_HOST=kong-postgres-database” -e “KONG_CASSANDRA_CONTACT_POINTS=kong-postgres-database” kong:latest kong migrations up Unable to find image ‘kong:latest’ locally
    latest: Pulling from library/kong
    0a6724ff3fcd: Pull complete 274efec6805c: Pull complete 87d5cdce85c4: Pull complete 83d64491ed12: Pull complete Digest: sha256:255db29e37ed7db52d0599252e635e6757480b28ea3b0973d535813fec153297
    Status: Downloaded newer image for kong:latest
    Error: [PostgreSQL error] failed to retrieve PostgreSQL server_version_num: temporary failure in name resolution

Leave a Reply

Your email address will not be published. Required fields are marked *