I have installed an Azure self hosted agent (Linux) and am following the documentation from https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/docker?view=azure-devops.
I have succeeded in installing the agent however when I run a Docker Build task which compiles and builds a docker image I am getting an error Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
After googling the issue it seems the code below should mount the docker.sock and I should be able to build and push docker images successfully, however this did not work on AKS
volumeMounts:
- mountPath: /var/run/docker.sock
name: docker-volume
volumes:
- name: docker-volume
hostPath:
path: /var/run/docker.sock
Has anyone encountered any such issue? I am building using AzureDevops Docker@2
task and agent is running on AKS 1.19.11