Docker Community Forums

Share and learn in the Docker community.

Docker restart image is loosing link and port connections?


(Vasyaivanov) #1

Hi. I am using docker to run Kong (api forwarding framework).
It works after I create image, but does not work after I restart the image. Any help would be great?
Here are my steps:

  1. I do: docker run -d --name kong --link cassandra:cassandra -p 8000:8000 -p 8443:8443 -p 8001:8001 -p 7946:7946 -p 7946:7946/udp mashape/kong -> and it works!
  2. I do: curl http://127.0.0.1:8001 (it works!)
  3. I do: docker stop kong
  4. I do: docker start kong
    5, I do: curl http://127.0.0.1:8001 (it does NOT work)

Anyone can see if link or ports are lost after I do restart?


(Илья) #2

What docker version do you have?

This commands can help you:

  1. docker port kong
  2. docker inspect -f '{{ .NetworkSettings.Ports }}' kong

To test link (eg. container visibility) you can:

  1. docker exec -it kong cat /etc/hosts and looks for cassandra container
  2. try to ping it into linked container via docker exec -it kong ping cassandra