-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
Port bindings fail on Docker for Mac #4783
Comments
You might want to try sharing the contents of you YAML files and the command you're executing. |
I run the commands: Here's the file:
|
|
Why are you setting everything to use the |
@c-Monster any progress on this? |
@shin- I'm setting everything to network |
Okay, but port bindings aren't applied when networking directly on the host, so what you're seeing is expected behavior. See: https://docs.docker.com/engine/userguide/networking/
|
Hi there!
web service can't connect to db service via 3307 exposed port. But can connect with internal container 3306 port |
MBP-Paul:docker-dir paul$ docker ps
ports looks like exposed but web can't connect to db:3307 |
@shin For this repo's examples, they're using @paul-ovchinnikov Whick Docker version you're using? |
@inancgumus the latest version (docker version):
docker-compose version:
|
@inancgumus That repo's @paul-ovchinnikov When you use a non-bridge network, the exposed port is only for accessing the container from your host. Containers that are part of the same network interact on their internal ports. This is normal behavior. |
@shin- Yeah, I know that, thx anyway. I and others have also opened many issues there already. I was trying to find non-official solution. There are several hacky attempts already trying to fix it. Docker for Mac is not enough for some purposes yet. Docker Linux support is better. |
The non-Linux experience has made great strides in the past couple years, but containers are unfortunately not a native feature on OS X. |
@shin- Yeah, the progress so far is good but not enough. Instead of waiting for the full support for OS X like Linux, I'm developing on my own Docker network, with a linux based docker-machine. |
@shin- I use custom network with bridge driver. See in the end of my docker-compose.yml |
@paul-ovchinnikov My bad - "non-bridge" in my previous message referred to any network that are not the (default) network named |
@shin- Thanks! Now it's clear. And this behavior explained in docker doc - networking |
I specify the port bindings in the
docker-compose-build.yml
, but when I rundocker-compose
, anddocker-ps
there is no listing for any ports, nor can I hit them with Postman.The text was updated successfully, but these errors were encountered: