Parallels / docker-machine-parallels

Parallels driver for Docker Machine https://github.com/docker/machine
MIT License
471 stars 35 forks source link

Port mapping is invalid #89

Closed sbfkcel closed 4 years ago

sbfkcel commented 4 years ago

image

Viewing the container shows that the port mapping is normal. However, the local port is not visible.


The default network configuration used

dskr99 commented 4 years ago

Please post a problem report from Parallels: Help -> Send technical data and post here it's number

legal90 commented 4 years ago

@sbfkcel What you see in docker ps output is relevant to your DOCKER_HOST, which is your virtual machine created with docker-machine. The port is listened on the VM interface, not on your Mac.

If you want to access the port from your Mac, get the VM's IP by running docker-machine ip <vm name> and use it instead of 127.0.0.1. (ref: https://github.com/Parallels/docker-machine-parallels/issues/53#issuecomment-222762658)

In your case it will be something like this: 10.211.55.5:1081

And this is how you can run netstat (and any other command) in your docker-machine VM:

docker-machine ssh <vm_name> -- netstat -nat 
sbfkcel commented 4 years ago

@legal90 Thank you. The problem is solved.