I know there are a ton of similar issues, but none of them are working for me!
I'm running docker on Ubuntu 22.04.1 LTS. All I want to do is access a Elasticsearch-Instance that i mapped onto Port localhost:9208
via SSH-Tunnel, without switching the docker containers network mode to host
.
Here is my minimal docker-compose.yml
example:
version: '3'
services:
curl_test:
image: curlimages/curl
command: "curl http://localhost:9208"
Output:
curl: (7) Failed to connect to localhost port 9208 after 0 ms: Connection refused
I tried:
- Using the workaround using
"host.docker.internal:host-gateway"
- Specifiying
extra_hosts
- Mapping Port 9208 directly into the container
I know that this minimal example does not work. But all the fixes/changes proposed are not working. So I'm very glad for any suggestions for this problem.