-1

I am trying to run Kong API Gateway using a docker container. I followed the instructions on hub.docker.com/_/kong/, started Cassandra database and Kong.

I have Cassandra running using the below command:

docker run -d --name kong-database \
           -p 9042:9042 \
           cassandra:3

and Kong running using the below command:

docker run -d --name kong \
          --link kong-database:kong-database \
          -e "KONG_DATABASE=cassandra" \
          -e "KONG_CASSANDRA_CONTACT_POINTS=kong-database" \
          -p 8000:8000 \
          -p 8443:8443 \
          -p 8001:8001 \
          -p 7946:7946 \
          -p 7946:7946/udp \
          kong:latest

Both containers are running. (I don't have enough reputations to embed pictures here right now so please see a screenshot here: my container list)

However when I do:

$ curl http://127.0.0.1:8001 

I got this:

curl: (7) Failed to connect to 127.0.0.1 port 8001: Connection refused

Can anyone let me know what is the possible reason?

desertnaut
  • 57,590
  • 26
  • 140
  • 166

1 Answers1

1

Ok, check the logs of the kong container to find any errors if there are any(docker logs kong).

If there aren't any errors, please check whether there is any active process running on the port or not(sudo netstat -anp | grep 8001). That will help us know whether the docker-container port 8001 was properly binded to server port 8001 and also the ip on which the port is running.

If there is process running on that port, then it might be an issue of running docker on bridge network which is not able to bind the port with localhost. try re-running the container with network host(--net host). Then it should work fine.