Azure Pipelines self-hosted Linux agent docker container
303
This is a custom Azure Pipelines agent created as a Linux container to replace the deprecated Microsoft Pipelines Agent. It is based off Ubuntu 16.04 & contains most of the software that is installed on the Microsoft-hosted Ubuntu 16.04 agents.
The image is based on a merge of the instructions Running a self-hosted agent in Docker: Linux & adding installer scripts from the official images found in the Github repo Microsoft/azure-pipelines-image-generation.
Almost all software installed on the base Ubuntu hosted VM agent's that Microsoft maintains is installed in this image. Some things were not installed that I personally don't use at this time. All scripts from the Ubuntu 16.04 image are in this repo & listed in the
Dockerfilefor install, but some have been commented out.
The Azure Pipelines agent must be started with account connection information, provided through environment variables:
| Env Variable | Description | Example |
|---|---|---|
| AZP_URL | required Url to the Azure DevOps account | https://dev.azure.com/contoso |
| AZP_TOKEN | required Azure DevOps user account personal access token (PAT) granting access to the AZP_URL | ****** |
| AZP_AGENT_NAME | optional Name of the agent. If not specified, the container's hostname is used | mydockeragent |
| AZP_POOL | optional Azure Pipelines agent pool name. If not specified, Default is used. | My Custom Agent Pool |
| AZP_WORK | optional Work directory. If not specified, _work is used. | _work |
Example:
docker run \
-e AZP_URL=https://dev.azure.com/contoso \
-e AZP_TOKEN=m23qugcXXXXXXXXXXXXXXXmvurfvra \
-e AZP_AGENT_NAME=mydockeragent \
azure-pipelines-linux-agent:latest
Once the agent is running, it will appear in the list of agents in the specified DevOps pipeline agent pool.
Running the image will execute the start.sh script. This script checks for required environment variables first & then downloads+installs the latest Azure Pipelines agent. After installing the latest agent, it configures it and starts it up to listen for jobs.
Content type
Image
Digest
Size
1.4 GB
Last updated
about 7 years ago
docker pull andrewconnell/azure-pipelines-linux-agent:dev-service