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.

  • Install Python mysqlclient on Ubuntu docker container
  • How to add more feature to a official postgres image from docker hub?
  • Docker: cannot access the folder structure of based image
  • Accessing MySQL Database on Host Machine from within Dockers Container
  • Python console within Pycharm in a Ubuntu Virtualbox fails to connect
  • Create files / folders on docker-compose build or docker-compose up
  • Running 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

  • Docker build error on Mac OS X
  • docker nginx container not receiving request from outside, connection refused
  • Can't visit `http://172.17.0.2:5000` after starting docker registry
  • Web Server and Database Server in a Docker Container
  • $GEM_HOME and $GEM_PATH are wrongly set in Passenger
  • Vagrant, Docker, and Node.js on Mac OS X
  • 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?

    1) 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

    2)
    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.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.