-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Cannot Access Site From External Machine - Windows 10 / WSL2 #73
Comments
some probleme |
Anyone have any luck with this. I am trying to access the container from browerstack/lambdatest but it can't connect. is it possible to expose the container for this purpose? |
I posted the question on the docker forum and got NO RESPONSE. Someone must know if it is possible or not. In the meantime, I will just stay away from Windoze, and keep developing on Linux, where it works perfectly. |
I've made some imporvments on this and wrapped it as devcontainer for use in vscode. Give it a try: You should be able to use it in windows. |
How does this solve the problem of making the container visible from another machine? |
damn, this awful self promotion, I've must have come across as a spammer :) You have two options, one is complex, second easy but it is different from your usual approach. Easy - ngrokUse tunnelling app that was designed for your use case like ngrok. It replaces dyndns and https configuration. Just run:
From a place you see the service on localhost, like your container.
The upsides:
The downsides:
Alternatively you pay them 5 usd / month for fixed reserved domain under ngrok, or 8 usd for your whitelabel domain with fixed ip etc. I would go for that for client presentation. Installation in containerInstallation of ngrok is rather easy, on both windows and in the linux container, on mac M1 all I had to do is:
Complex - basically build ngrok yourselfThe issue with docker on WSL and macos is that it works in a linux virtual machine that has it's own internal firewall. So you can setup the package forwarding on your docker vm, and on windows , it may or may not work. I use HAproxy or Nginx on macos, from what I read only nginx is native on windows, haproxy works in wsl. I can't test this as I don't have windows at hand at the moment. |
I am familiar with ngrok. This is not the question that the thread is asking. First of all, all of this relates to using the docker-compose script in the repository, so other methods of using docker are not relevant. The question is why I can access the container from another machine on the LAN when it is running on Linux, but not when the script is running on Windows. None of your comments are relevant to the issue. Please delete them. |
It seems that by making my post long I've manage to hide the answer :(, sorry about that. If you focus on exposing a port on local network, so that your colleagues can access but noone else, you should follow the "Complex" way and expose your ports with To give you a bit more context.
Docker-compose (docker in general) on windows and mac, runs in a VM and networking of this VM is not exposed to your host windows /macos. Docker have a custom kernel driver to do the networking so that you can access it on localhost. I know a work around for the issues it is described in the complex way in previous post.
Please note docker-compose is just a fancy way to run docker, so when you try to find a solution look for docker not docker-compose. Most of things you can do with docker you can do with docker-compose. |
Update ports of wp |
This may be a Windows problem rather than a problem with the Container.
I usually start working on a site using localhost:80. It works well on Linux and Windows. At some point I need to give it an external URL for testing eCommerce apps. I usually do this by implementing SSL as I described in a previous issue, and use a DynDns app to provide an External URL.
It works perfectly if I bring up the container on Linux, but I cannot access the site if I bring it up on Windows (I am using docker desktop with the WSL2 interface). I can still access the site via localhost, but not via the external URL. I have tried opening port 80 and 443 on the Windows Firewall, but other than that I have not been able to figure out why I cannot access the site. I'm hoping that if this is a Windows issue, that one of you who use Windows more frequently will have a clue to the problem, as I use Windows as little as possible.
Thanks - John
The text was updated successfully, but these errors were encountered: