Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tunnel access is not working in docker container M1 #5374

Closed
tealcake2 opened this issue Feb 21, 2021 · 11 comments
Closed

Tunnel access is not working in docker container M1 #5374

tealcake2 opened this issue Feb 21, 2021 · 11 comments

Comments

@tealcake2
Copy link

tealcake2 commented Feb 21, 2021

Hi,

on apple M1 Tech preview,

I trying to connect to mysql server with ssh tunnel, but it is not working.

When I trying connect to tunnel from container with host.docker.internal, I got connection refused.

on another pc without M1 version it is working fine

@tealcake2 tealcake2 changed the title Tunnel is not working in docker container M1 Tunnel access is not working in docker container M1 Feb 21, 2021
@stephen-turner
Copy link
Contributor

mysql doesn't work properly on M1 because there isn't an arm64 build of it. In the documentation (https://docs.docker.com/docker-for-mac/apple-m1/) we suggest using mariadb instead.

@stephen-turner stephen-turner added the area/m1 M1 preview builds label Feb 22, 2021
@tealcake2
Copy link
Author

tealcake2 commented Feb 22, 2021

??? this is totaly diffrent issue ... i do not have problem with mysql container, I just can not connect to tunneled connection ip

So when I create ssh tunnel connection in my macos to production mysql, for example to port 23306, then I do not have access to it from docker container, for example from php-fpm container I can not connect to production mysql with host host.docker.internal:23306

@goyan
Copy link

goyan commented Mar 1, 2021

agreed, issue is connection refused when connecting to host process by port.
On my side, I can't access to host process using ports, 8001, 5432.

docker.host.internal resolves to an IP, pings correctly from docker, but connection is refused on processes by port.

with latest docker at time of writing. (.. .3)

@beijaflor
Copy link

I have same problem here. I can't connect hosts 9200 port which connect to GCP compute engine via ssh tunneling.
While trying to solve this problem, I found that It's also happen when to connect ssh tunneling port of other container in same network bridge. It may not only problem with host to container connection, but entire network.

For work around, I make connection inside the container and it works.
But it's really ugly and not-handy solution. Looking forward to solve this issue...

@leandregagnonlewis
Copy link

leandregagnonlewis commented Mar 24, 2021

Same problem! When i look in /etc/hosts there is no added host for host.docker.internal so it is impossible to resolve.

root@bc81cc5b3bce:/home# cat /etc/hosts
127.0.0.1	localhost
::1	localhost ip6-localhost ip6-loopback
fe00::0	ip6-localnet
ff00::0	ip6-mcastprefix
ff02::1	ip6-allnodes
ff02::2	ip6-allrouters
172.17.0.2	bc81cc5b3bce

Edit: i am still able to ping it so it seems the hostname is resolved. I can't connect to my app on port 53593

@ryanoillataguerre
Copy link

ryanoillataguerre commented Apr 9, 2021

Hello! I'm running into the same issue on an M1 when using tunnels specifically. I'm tunneling to a postgres DB on localhost:5432, which is reachable using psql from my local, but when I pass the same connection string as used in the terminal into the docker app as an ENV var but with host.docker.internal instead of localhost, it refuses connection.

FWIW, host.docker.internal:5432 is being translated to 192.168.64.1:5432 internally.

Also, this exact same configuration worked fine on my last Intel Macbook.

Our entire docker-compose dev workflow revolves around this tunneling into our DB, so would really like to know if there's a valid workaround. Haven't been able to find anything on support forums that's worked.

@nitinv80
Copy link

nitinv80 commented May 5, 2021

Hi, I am also running the same issue. IS there any solution or patch found?

@aaronfagan
Copy link

Also seeing this issue now Reverse Proxying (Container) to Plex (Host).

@jmarbutt
Copy link

I am having this issue also, any updates?

@docker-robott
Copy link
Collaborator

Issues go stale after 90 days of inactivity.
Mark the issue as fresh with /remove-lifecycle stale comment.
Stale issues will be closed after an additional 30 days of inactivity.

Prevent issues from auto-closing with an /lifecycle frozen comment.

If this issue is safe to close now please do so.

Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows.
/lifecycle stale

@docker-robott
Copy link
Collaborator

Closed issues are locked after 30 days of inactivity.
This helps our team focus on active issues.

If you have found a problem that seems similar to this, please open a new issue.

Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows.
/lifecycle locked

@docker docker locked and limited conversation to collaborators Nov 26, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

10 participants