Azure-pipelines-tasks: Issues getting docker daemon running on Windows/MacOS with DockerInstaller

Created on 4 May 2020  路  2Comments  路  Source: microsoft/azure-pipelines-tasks

Type: Bug

Enter Task Name: DockerInstaller@0

Environment

Issue Description

I'm trying to run unit tests on Windows, MacOS, and Linux which required docker to be running. For example, I have a unit test which runs docker build, and will fail if docker isn't running.

From what I can tell, of the agents we have, docker is running on Linux, but not macOS or Windows. I'm trying to use the DockerInstall to install and start docker, however I'm hitting issues on both OS.

You can see a list of different things I have tried here: https://github.com/dotnet/tye/pull/430. I'll describe some below

Windows

After running,

        - task: DockerInstaller@0
          displayName: Docker Installer
          inputs:
            dockerVersion: 17.09.0-ce
            releaseType: stable

I get the following error when trying to run

        - script: docker version
error during connect: Get http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.32/version: open //./pipe/docker_engine: The system cannot find the file specified. In the default daemon configuration on Windows, the docker client must be run elevated to connect. This error may also indicate that the docker daemon is not running.

From this error, I don't know if there is a permissions issue or that the daemon isn't running. I've tried to run dockerd.exe, however I realize the DockerInstall task doesn't cache that.

MacOS

Running:

        - task: DockerInstaller@0
          displayName: Docker Installer
          inputs:
            dockerVersion: 19.03.5
            releaseType: stable

I get the following error when running docker version afterwards

ERROR: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

I've tried to follow https://github.com/MicrosoftDocs/azure-devops-docs/issues/3784, however that didn't work for me either.

Any insight on what I should be doing to fix this?

Release bug

Most helpful comment

Hi! DockerInstaller task is meant to install Docker CLI. You still need to have a docker daemon running on your agent (only if it is self-hosted ) to be able to execute docker commands.

All 2 comments

Hi, I've the same problem on MacOS, I have:

Warning: failed to get default registry endpoint from daemon (Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?). Using system default: https://index.docker.io/v1/
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

What to do?

Hi! DockerInstaller task is meant to install Docker CLI. You still need to have a docker daemon running on your agent (only if it is self-hosted ) to be able to execute docker commands.

Was this page helpful?
0 / 5 - 0 ratings