Reputation: 432
I have installed a DIGITS docker on my Azure VM. I am trying to connect to this Docker using its IP Address from my local machine (outside the VM). I have not had any success in doing so. Is this even possible? If so, how?
I have the IP Address of the Docker from running docker inspect <container-ID> | grep IPAddress
. Doing a curl on the obtained IPAddress with the specific port does not connect to the Docker.
Upvotes: 3
Views: 7466
Reputation: 974
Assuming your host/remote machine is running Linux - If you want to access the container (running on a remote server) directly from local machine you should first install SSH Server in the container and map the 22 port of container to a port on host. And then open that host port and protocol TCP (to let SSH) for inbound traffic on NSG in Azure portal (as told by Chun/Jason)
Upvotes: 1
Reputation: 13954
As Chun-Yen Wang said, you should add the port exposed to Azure NSG.
For example, I expose docker on port 5000, add inbound rules via Azure portal like this:
After that you can use Azure VM's public IP address to access it, you can find your public IP address here:
curl http://52.168.28.103:5000
Hope that helps.
Upvotes: 5
Reputation: 578
The docker containers on Azure VM can be accessed via the public IP address of the host VM, and the port exposed:
Upvotes: 2