On Mac OS (running Docker Machine) using --service-ports with docker-compose does not solve the problem when using curl from the host -- the -p option is the only way to solve it. Is this a bug I should be submitting as a GitHub Issue or am I missing something else? Thanks for the response @dmaze.The struggle I’m having is that when I bring up a docker application such as a web server, it registers port 80:80 with the host and I can reach it by calling localhost:80 on my Mac.
I've been following tutorial on getting started with Kubernetes using Docker containers, which is a variation of official tutorial modified to use docker-compose. I've managed to get as far as listing the nodes using kubectl get nodes but I can only do that if I have an SSH connection open to the container in another window, opened using docker-machine ssh docker-vm -L 8080:localhost:8080 This is quite messy and I'd like to be able to handle this in the docker-compose.yml, but I don't know how I've tried using the ports and expose options in the iml file, but they do not work. When I try to forward/expose port 8080 and get the nodes using the above kubectl command, I get the following error: error: couldn't read version from server: Get EOF I've used the docker-compose.yml from the first link at the top, and made the following modifications: aipserver: ports: - '8080:8080' expose: - '8080' I've tried this on all of the containers specified in the docker-compose.yml, but the problem persists. How can I use the docker-compose.yml to forward/expose ports on my containers without having to open an SSH connection with the -L option specified.