I have a mongoDB container running on an instance built with docker-machine
, maintained with docker-compose
. The mongoDB process isn't exposed to external traffic.
I want to connect to the remote mongoDB server using a GUI tool installed locally and without exposing any ports on the remote machine.
What's the best way to do this? Is there any way I can tunnel the connection via ssh with the docker-machinie ssh
command?
What's the best way to do this? Is there any way I can tunnel the connection via ssh with the docker-machinie ssh command?
Yes. Per the docs, docker-machine
invokes the standard OpenSSH client. You can use the same -L
syntax that you'd normally use for SSH tunneling. The end of the doc has an example using port 8080
.