azure-pipelines-agent: Docker socket is not accessible from inside the Docker container

Agent Version and Platform

Version of your agent? 2.144.0

OS of the machine running the agent? Linux; Ubuntu 16.04 with Docker

Azure DevOps Type and Version

Azure Pipelines

What’s not working?

The container job in BoardGameGeek.Dungeon/azure-pipelines.yml, which uses cake-build/cake via a Docker container (cake-docker/Dockerfile) and Cake.Dungeon scripts to build and push a Docker image to Docker Hub, is not working as expected because the Docker socket is not accessible from inside the Docker container.

See BoardGameGeek.Dungeon/#20190115.6/Docker job for all the build step environment variables, which have been logged as seen from inside the container. Note the error at the bottom:

Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock

Is there a way to mount or otherwise make the Docker socket accessible to Azure Pipelines container jobs?

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 23 (11 by maintainers)

Commits related to this issue

Most upvoted comments

@bryanmacfarlane this one feels like it’s standing in the way of a fully sane Docker experience. When someone frees up from a bigger rock, we can take this one tactically.

the agent has released, the user inside the container should have access to docker daemon without sudo, i am going to close this issue for now, please reopen if needed.

i create a PR #2142 might help this scenario.

@gitfool when you define the container in your yaml file, you can provider addition options for docker create.

- container: ubuntu
    image: ubuntu:16.04
    options: '--group-add docker'