0
votes

I created an Azure DevOps agents based on the Ubuntu image that can be found here: https://github.com/Microsoft/azure-pipelines-image-generation

After I deployed the machine and installed the agent (see https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/v2-linux?view=vsts) I ran a Docker task and got the following error:

dial unix /var/run/docker.sock: connect: permission denied

What do I have to do to get the Docker task executed successfully?

1

1 Answers

1
votes

The problem is that the agent service has not the permissions to connect. You can either run the agent service as root (sudo ./svc.sh install root) what I would not recommend or add the user to the Docker group via sudo usermod -a -G docker $USER.

Then logout and and log in again and it should work.

See also https://docs.docker.com/install/linux/linux-postinstall/