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

  • Installing maven in a docker build overrides JAVA 8 with JAVA 7(!)
  • Executing docker run command from config file
  • Node webservice in Docker with entrypoint fails but works otherwise
  • Java8 base image has java7 installed docker
  • Enable JMX in Tomcat docker container
  • database and collections created in docker container cant be found in committed docker image
  • 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

  • Cannot set up Kubernetes local cluster via Docker
  • Docker 0.9 - /etc/sysctl.conf not working
  • Expose container port to Host using Docker for Windows in Windows 10
  • Docker for Windows not working
  • Docker push to Artifactory fails - unable to ping resgistry endpoint
  • How to run built Docker image made by docker-compose?
  • 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:

    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

    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.