Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Docker Machine SSH tunneling

As described on the Docker Machine SSH reference, the docker-machine CLI invokes the standard OpenSSH client so we can use the common SSH tunneling syntax here. The following command will forward port 3000 from the default machine to localhost on your host computer's loopback interface. Using as bind_address will make it bind to all interfaces:

$ docker-machine ssh default -L

So, the container running at machine's port 3000 can be reached through localhost:3000 or any of your interfaces' IP (i.e. That'd be useful to access your containerized services from other devices in your LAN.


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment