[GH-ISSUE #424] reach the localhost from inside docker-osx #304

Closed
opened 2026-02-27 22:08:58 +03:00 by kerem · 4 comments
Owner

Originally created by @alexerisov on GitHub (Jan 17, 2022).
Original GitHub issue: https://github.com/sickcodes/Docker-OSX/issues/424

I wanna open localhost webserver in safari inside docker-osx. How can i do that?

Originally created by @alexerisov on GitHub (Jan 17, 2022). Original GitHub issue: https://github.com/sickcodes/Docker-OSX/issues/424 I wanna open localhost webserver in safari inside docker-osx. How can i do that?
kerem closed this issue 2026-02-27 22:08:58 +03:00
Author
Owner

@sickcodes commented on GitHub (Jan 18, 2022):

Local webhost webserver example for safari inside Docker-OSX right here :)

https://github.com/sickcodes/Docker-OSX#forward-additional-ports-nginx-hosting-example

<!-- gh-comment-id:1015238967 --> @sickcodes commented on GitHub (Jan 18, 2022): Local webhost webserver example for safari inside Docker-OSX right here :) https://github.com/sickcodes/Docker-OSX#forward-additional-ports-nginx-hosting-example
Author
Owner

@alexerisov commented on GitHub (Jan 18, 2022):

Yes, I've seen it, but this example describes how to start nginx in docker-osx and get it from localhost. But I wanna to start server on Local host and get it from inside docker-osx. I got problem that server and docker-osx require the same port on host machine. If I started server on 10024, Docker cannot start with same port. And if docker starts first, then server can't start.

<!-- gh-comment-id:1015431953 --> @alexerisov commented on GitHub (Jan 18, 2022): Yes, I've seen it, but this example describes how to start nginx in docker-osx and get it from localhost. But I wanna to start server on Local host and get it from inside docker-osx. I got problem that server and docker-osx require the same port on host machine. If I started server on 10024, Docker cannot start with same port. And if docker starts first, then server can't start.
Author
Owner

@sickcodes commented on GitHub (Jan 20, 2022):

From inside the mac, you can reach 192.168.1.x naturally.

On host:
nginx will start on 80
ip addr will show all your IP's and bridges, which are localhost.

For me, I can visit the host on any of:

172.17.0.1
172.16.32.1
192.168.63.1
192.168.122.1
192.168.1.4

<!-- gh-comment-id:1017295993 --> @sickcodes commented on GitHub (Jan 20, 2022): From inside the mac, you can reach 192.168.1.x naturally. On host: `nginx` will start on 80 `ip addr` will show all your IP's and bridges, which are localhost. For me, I can visit the host on any of: 172.17.0.1 172.16.32.1 192.168.63.1 192.168.122.1 192.168.1.4
Author
Owner

@alexerisov commented on GitHub (Jan 20, 2022):

Yep, It works. Thanks, you. I had tried 127.0.0.1:3000 and localhost:3000, and it had not worked. But as you advice 172.17.. and 192.168 works now. Thanks again )

<!-- gh-comment-id:1017555900 --> @alexerisov commented on GitHub (Jan 20, 2022): Yep, It works. Thanks, you. I had tried 127.0.0.1:3000 and localhost:3000, and it had not worked. But as you advice 172.17.. and 192.168 works now. Thanks again )
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/Docker-OSX#304
No description provided.