Skip to content

norcis/docker-azure-pipelines-agent-windows

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Azure Pipelines Agent Docker Image

This repository contains Dockerfile definitions for lambda3/azure-pipelines-agent.

It will not work with Azure DevOps Server.

Downloads from Docker Hub Stars on Docker Hub Build Status

Supported tags

Configuration

You need to set these environment variables:

  • AGENT_PAT - The personal access token from Azure Pipelines. Required.
  • VS_TENANT - The Azure Pipelines tenant, a.k.a. the value that goes before .visualstudio.com, i.e., on foo.visualstudio.com, should be foo. Required.
  • AGENT_POOL - The agent pool. Optional. Default value: Default

Running

On Windows, use Docker for Windows and run, on PowerShell:

docker run --name azure-pipelines-agent-windows -ti -e VS_TENANT=$env:VS_TENANT -e AGENT_PAT=$env:AGENT_PAT -d lambda3/azure-pipelines-agent-windows

For the agent to work as expected mount c:\agent\_works from the host to the agent container, adding to docker run -v c:\agent\_works:c:\agent\_works, like so, on PowerShell:

docker run --name azure-pipelines-agent-windows -ti -e VS_TENANT=$env:VS_TENANT -e AGENT_PAT=$env:AGENT_PAT -d -v c:\agent\_works:c:\agent\_works lambda3/azure-pipelines-agent-windows

This will keep the agent staging directory (and other work directories) persistent across agent restarts. Also, it is recommended that you mount to a directory that is relative to this directory, like the staging directory, so when it is mounted on the host, it is also available for the agent.

With Docker

If you want to run Docker on Docker, and access the underlying Docker engine, you have to mount the Docker named pipe, and user the docker tag of this repository, like so:

docker run --name azure-pipelines-agent-windows -ti -v \\.\pipe\docker_engine:\\.\pipe\docker_engine -e VS_TENANT=$env:VS_TENANT -e AGENT_PAT=$env:AGENT_PAT -d -ti azure-pipelines-agent-windows:docker

When using docker-compose you will need the full syntax to mount the named pipe. See this example.

Maintainers

License

This software is open source, licensed under the Apache License, Version 2.0. See LICENSE.txt for details. Check out the terms of the license before you contribute, fork, copy or do anything with the code. If you decide to contribute you agree to grant copyright of all your contribution to this project, and agree to mention clearly if do not agree to these terms. Your work will be licensed with the project at Apache V2, along the rest of the code.

Releases

No releases published

Packages

No packages published

Languages

  • Dockerfile 85.1%
  • PowerShell 14.9%