For agent
, you need to set these environment variables:
AZP_URL
- Required. The Azure DevOps organizationAZP_TOKEN
- Required. The personal access token PAT from Azure DevOps.AZP_POOL
- The agent pool. Optional. Default value:Default
AZP_AGENT_NAME
- Name of agent to be displayed in DevOps Agent PoolAZP_WORK
- Folder where the build will be executed. Default value:_work
On a Mac, use Docker for Mac, or directy on Linux, run in bash:
To start a container in detached mode:
docker run --name devops-agent-pool-win `
-d `
-e AZP_URL=https://dev.azure.com/your_subscription/ `
-e AZP_TOKEN=your PAT `
-e AZP_POOL=your agent pool name `
-e AZP_AGENT_NAME=your agent name `
-e AZP_WORK=G:\_work `
-v D:/UserData/dk-agent-01:C:/data `
lzocateli/devops-agent-pool-win:1.0.0
To start a container in foreground mode:
docker run --name devops-agent-pool-win `
-ti `
--rm `
-e AZP_URL=https://dev.azure.com/your_subscription/ `
-e AZP_TOKEN=your PAT `
-e AZP_POOL=your agent pool name `
-e AZP_AGENT_NAME=your agent name `
-e AZP_WORK=G:\_work `
-v D:/UserData/dk-agent-01:C:/data `
lzocateli/devops-agent-pool-win:1.0.0
The -v parameter indicates that a volume is being mounted on the container host, so it will be possible to keep the _work folder even if the container is not running. If you do not want to use a volume on the host, just remove the -v line from docker run.
- git clone from this repository
- Edit file /devops-agent-pool-win/agent/install-agent.ps1, change variable $agentVersion = "2.186.1"
- cd /devops-agent-pool-win/docker
- execute: build-docker-agent.ps1 -dockerId xxxxx -dockerToken yyyyyyyyyyyyy
- A docker image will be created, run the command docker run (described above) or run-container.ps1 (which should be in your path)