Self-hosted Azure Pipelines Agent in Docker
924
Self-hosted Azure Pipelines Agent in Docker
Runs a build agent on your own hardware. Useful if either your source code or your deplyment environments are hosted in private infrastructure, but you still want to power of automation of Azure DevOps.
Based on Microsoft docs: https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/docker?view=azure-devops
The image is hosted on Docker Hub: https://hub.docker.com/repository/docker/olilanz/azure-pipelines-docker-agent
docker run -e AZP_URL=<Azure DevOps instance> -e AZP_TOKEN=<PAT token> -e AZP_AGENT_NAME=mydockeragent olilanz/azure-pipelines-docker-agent:latest --once
Build the image using the docker build command:
docker build -t olilanz/azure-pipelines-docker-agent:latest .
For supporting build jobs that require access to a Docker Engine, you will need to mount the Docker socket into the container, and run the container in privileged mode. This will give the build agent full access to Docker Engine.
docker run -e AZP_URL=<Azure DevOps instance> -e AZP_TOKEN=<PAT token> -e AZP_AGENT_NAME=mydockeragent -v /var/run/docker.sock:/var/run/docker.sock --privileged dockeragent:latest --once
Note that this elevates the agent to run as root, which may have severe security implications. Do this only in environments and configurations you trust.
Content type
Image
Digest
Size
397.3 MB
Last updated
over 4 years ago
docker pull olilanz/azure-pipelines-docker-agent