-1

I built a docker container inside a GCE Instance (Google Compute Engine instance). I want to access GCP instance internal IP inside this docker.

Try to access GCE internal IP inside docker:

$ curl 172.0.28.1:9200

I got a timeout for the connection.

Spears
  • 2,102
  • 1
  • 17
  • 27
Le Khiem
  • 793
  • 6
  • 9

2 Answers2

1

Inside container:

curl $(ip route show default | awk '/default/ {print $3}'):9200
0

I understand you created a VM instance in GCE and installed docker with an image. You are trying to reach the IP of the docker container from outside the hosting machine

You can find the answer in this stackoverflow post [1]

1 How to expose docker container's ip and port to outside docker host without port mapping?

Ernesto U
  • 786
  • 3
  • 14