Cannot connect to Docker daemon in Azure Container Service
I’m trying to run docker commands from my local machine against a Azure Container Service with Docker Swarm. The command I use is as follows
docker -H tcp://<ip address>:2375 ps docker -H tcp://<hostname of mgmt box>.eastus.cloudapp.azure.com:2375 ps
Both commands render
Cannot connect to the Docker daemon. Is the docker daemon running on this host? I can ssh to the management machine and run docker commands so I know docker is working properly. There aren’t any security groups associated with the resource so there doesn’t appear to be any firewall problem.
docker ps on the machine directly I can see swarm running on port 2375. I’ve tried do access it via ports 2375,2376,3375,3376
3 Solutions collect form web for “Cannot connect to Docker daemon in Azure Container Service”
Looks like those ports aren’t publicly visible and I have to create an ssh tunnel source
The DC/OS and Docker Swarm clusters that are deployed by Azure Container Service expose REST endpoints. However, these endpoints are not open to the outside world. In order to manage these endpoints, you must create a Secure Shell (SSH) tunnel. After an SSH tunnel has been established, you can run commands against the cluster endpoints and view the cluster UI through a browser on your own system. This document walks you through creating an SSH tunnel from Linux, OS X, and Windows.
It sounds like you have not set up the secure tunnel to the cluster. Once you have don’t that you access via the tunnel, see: https://azure.microsoft.com/en-us/documentation/articles/container-service-connect/
What you maybe looking for is Docker-Machine?
Docker Machine is a tool that lets you install Docker Engine on
virtual hosts, and manage the hosts with docker-machine commands. You
can use Machine to create Docker hosts on your local Mac or Windows
box, on your company network, in your data center, or on cloud
providers like AWS or Digital Ocean.
You can use docker-machine to:
- Install and run Docker on Mac or Windows
- Provision and manage multiple remote Docker hosts
- Provision Swarm clusters
Perhaps scripting via
Docker’s remote REST APIs
3) Take a look at Azure Container Service documentation
Connect to an Azure Container Service cluster
After creating an Azure Container Service cluster, you need to connect
to the cluster to deploy and manage workloads. This article describes
how to connect to the master VM of the cluster from a remote computer.