Hello, I’ve little problem with my docker container. I’m trying to get access by curl from container to my parent server localhost in order to execute query in elasticsearch. Elastic is working only local area on parent server.
curl http://127.0.0.1:9200
curl: (7) Failed to connect to 127.0.0.1 port 9200: Connection refused
The containers ip is 172.17.0.3 and Im able to ping container from parent server
Its my docker build
#!/bin/bash
cd ./api_docker
container="$(docker ps | grep "visitors/api:gniewoy" | cut -d " " -f1)"
git reset --hard HEAD &&
git pull &&
composer update &&
docker build -t visitors/api:gniewoy . &&
cd ../
docker kill $container &&
docker run -p 705:80 --env-file docker_api_env -d
After built the continer is working fine on port 705, but is only the elastic issue.
Below are deatils my conainer
"NetworkSettings": {
"Bridge": "",
"SandboxID": "",
"HairpinMode": false,
"LinkLocalIPv6Address": "",
"LinkLocalIPv6PrefixLen": 0,
"Ports": {
"443/tcp": null,
"80/tcp": [
{
"HostIp": "0.0.0.0",
"HostPort": "705"
}
]
},
"SandboxKey": "",
"SecondaryIPAddresses": null,
"SecondaryIPv6Addresses": null,
"EndpointID": "",
"Gateway": "172.17.0.1",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"IPAddress": "172.17.0.3",
"IPPrefixLen": 16,
"IPv6Gateway": "",
"MacAddress": "",
"Networks": {
"bridge": {
"IPAMConfig": null,
"Links": null,
"Aliases": null,
"NetworkID": "",
"EndpointID": "",
"Gateway": "172.17.0.1",
"IPAddress": "172.17.0.3",
"IPPrefixLen": 16,
"IPv6Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"MacAddress": ""
}
}
}
Im working od Debian 8. Thank you