Azure Pipelines Agent

Verified Publisher

azure-pipelines/vsts-agent

By Microsoft

Updated 10 months ago

Containerized agent for Azure Pipelines

0

About This Image

This repository contains images for the Visual Studio Team Services (VSTS) agent that runs tasks as part of a build or release.

VSTS agent images are tagged according to the base OS, an optional Team Foundation Server (TFS) version, and tools that are installed.

When used with VSTS, the agent version is automatically determined and downloaded at container startup based on the account to which the agent is connecting. When used with TFS, an image that matches the installed TFS version should be chosen.

How to Use this Image

VSTS agents must be started with account connection information, which is provided through two environment variables:

  • VSTS_ACCOUNT: the name of the Visual Studio account
  • VSTS_TOKEN: a personal access token (PAT) for the Visual Studio account that has been given at least the Agent Pools (read, manage) scope.

To run the default VSTS agent image for a specific Visual Studio account:

docker run \
  -e VSTS_ACCOUNT=<name> \
  -e VSTS_TOKEN=<pat> \
  -it mcr.microsoft.com/azure-pipelines/vsts-agent

When using an image that targets a specific TFS version, the connection information is instead supplied through one of the following environment variables:

  • TFS_HOST: the hostname of the Team Foundation Server
  • TFS_URL: the full URL of the Team Foundation Server
  • VSTS_TOKEN: a personal access token (PAT) for the Team Foundation Server account that has been given at least the Agent Pools (read, manage) scope.

If TFS_HOST is provided, the TFS URL is set to https://$TFS_HOST/tfs. If TFS_URL is provided, any TFS_HOST environment variable is ignored.

To run a VSTS agent image for TFS 2018 that identifies the server at https://mytfs/tfs:

docker run \
  -e TFS_HOST=mytfs \
  -e VSTS_TOKEN=<pat> \
  -it mcr.microsoft.com/azure-pipelines/vsts-agent:ubuntu-16.04-tfs-2018

A more secure option for passing the personal access token is supported by mounting a file that contains the token into the container and specifying the location of this file with the VSTS_TOKEN_FILE environment variable. For instance:

docker run \
  -v /path/to/my/token:/vsts-token \
  -e VSTS_ACCOUNT=<name> \
  -e VSTS_TOKEN_FILE=/vsts-token \
  -it mcr.microsoft.com/azure-pipelines/vsts-agent

Whether targeting VSTS or TFS, agents can be further configured with additional environment variables:

  • VSTS_AGENT: the name of the agent (default: "$(hostname)")
  • VSTS_POOL: the name of the agent pool (default: "Default")
  • VSTS_WORK: the agent work folder (default: "_work")

The VSTS_AGENT and VSTS_WORK values are evaluated inside the container as an expression so they can use shell expansions. The VSTS_AGENT value is evaluated first, so the VSTS_WORK value may reference the expanded VSTS_AGENT value.

To run a VSTS agent on Ubuntu 16.04 for a specific account with a custom agent name, pool and a volume mapped agent work folder:

docker run \
  -e VSTS_ACCOUNT=<name> \
  -e VSTS_TOKEN=<pat> \
  -e VSTS_AGENT='$(hostname)-agent' \
  -e VSTS_POOL=mypool \
  -e VSTS_WORK='/var/vsts/$VSTS_AGENT' \
  -v /var/vsts:/var/vsts \
  -it mcr.microsoft.com/azure-pipelines/vsts-agent:ubuntu-16.04

These images do not run "Docker in Docker", but rather re-use the host instance of Docker. To ensure this works correctly, volume map the host's Docker socket into the container:

docker run \
  -e VSTS_ACCOUNT=<name> \
  -e VSTS_TOKEN=<pat> \
  -v /var/run/docker.sock:/var/run/docker.sock \
  -it mcr.microsoft.com/azure-pipelines/vsts-agent:ubuntu-16.04-docker-17.12.0-ce

Full Tag Listing

Linux Images
TagsArchitectureDockerfileOsVersionCreatedTimeLastUpdatedTime
latestamd64No DockerfileUbuntu 16.0402/14/201902/14/2019
ubuntu-16.04amd64No DockerfileUbuntu 16.0401/22/201901/22/2019
ubuntu-16.04-standardamd64No DockerfileUbuntu 16.0401/22/201901/22/2019
ubuntu-16.04-docker-17.12.0-ceamd64No DockerfileUbuntu 16.0401/22/201901/22/2019
ubuntu-16.04-docker-17.12.0-ce-standardamd64No DockerfileUbuntu 16.0401/22/201901/22/2019
ubuntu-16.04-docker-18.06.1-ceamd64No DockerfileUbuntu 16.0401/22/201901/22/2019
ubuntu-16.04-docker-18.06.1-ce-standardamd64No DockerfileUbuntu 16.0401/22/201901/22/2019
ubuntu-16.04-tfs-2018-u2amd64No DockerfileUbuntu 16.0401/22/201901/22/2019
ubuntu-16.04-tfs-2018-u2-standardamd64No DockerfileUbuntu 16.0401/22/201901/22/2019
ubuntu-16.04-tfs-2018-u2-docker-17.12.0-ceamd64No DockerfileUbuntu 16.0401/22/201901/22/2019
ubuntu-16.04-tfs-2018-u2-docker-17.12.0-ce-standardamd64No DockerfileUbuntu 16.0401/22/201901/22/2019
ubuntu-16.04-tfs-2018-u2-docker-18.06.1-ceamd64No DockerfileUbuntu 16.0401/22/201901/22/2019
ubuntu-16.04-tfs-2018-u2-docker-18.06.1-ce-standardamd64No DockerfileUbuntu 16.0401/22/201901/22/2019
ubuntu-16.04-tfs-2018-u3amd64No DockerfileUbuntu 16.0401/22/201901/22/2019
ubuntu-16.04-tfs-2018-u3-standardamd64No DockerfileUbuntu 16.0401/22/201901/22/2019
ubuntu-16.04-tfs-2018-u3-docker-17.12.0-ceamd64No DockerfileUbuntu 16.0401/22/201901/22/2019
ubuntu-16.04-tfs-2018-u3-docker-17.12.0-ce-standardamd64No DockerfileUbuntu 16.0401/22/201901/22/2019
ubuntu-16.04-tfs-2018-u3-docker-18.06.1-ceamd64No DockerfileUbuntu 16.0401/22/201901/22/2019
ubuntu-16.04-tfs-2018-u3-docker-18.06.1-ce-standardamd64No DockerfileUbuntu 16.0401/22/201901/22/2019
ubuntu-14.04amd64No DockerfileUbuntu 14.0401/17/201901/22/2019
ubuntu-14.04-standardamd64No DockerfileUbuntu 14.0401/22/201901/22/2019
ubuntu-14.04-docker-17.12.0-ceamd64No DockerfileUbuntu 14.0401/22/201901/22/2019
ubuntu-14.04-docker-17.12.0-ce-standardamd64No DockerfileUbuntu 14.0401/22/201901/22/2019
ubuntu-14.04-docker-18.06.1-ceamd64No DockerfileUbuntu 14.0401/22/201901/22/2019
ubuntu-14.04-docker-18.06.1-ce-standardamd64No DockerfileUbuntu 14.0401/22/201901/22/2019
ubuntu-14.04-tfs-2018-u2amd64No DockerfileUbuntu 14.0401/22/201901/22/2019
ubuntu-14.04-tfs-2018-u2-standardamd64No DockerfileUbuntu 14.0401/22/201901/22/2019
ubuntu-14.04-tfs-2018-u2-docker-17.12.0-ceamd64No DockerfileUbuntu 14.0401/22/201901/22/2019
ubuntu-14.04-tfs-2018-u2-docker-17.12.0-ce-standardamd64No DockerfileUbuntu 14.0401/22/201901/22/2019
ubuntu-14.04-tfs-2018-u2-docker-18.06.1-ceamd64No DockerfileUbuntu 14.0401/22/201901/22/2019
ubuntu-14.04-tfs-2018-u2-docker-18.06.1-ce-standardamd64No DockerfileUbuntu 14.0401/22/201901/22/2019
ubuntu-14.04-tfs-2018-u3amd64No DockerfileUbuntu 14.0401/22/201901/22/2019
ubuntu-14.04-tfs-2018-u3-standardamd64No DockerfileUbuntu 14.0401/22/201901/22/2019
ubuntu-14.04-tfs-2018-u3-docker-17.12.0-ceamd64No DockerfileUbuntu 14.0401/22/201901/22/2019
ubuntu-14.04-tfs-2018-u3-docker-17.12.0-ce-standardamd64No DockerfileUbuntu 14.0401/22/201901/22/2019
ubuntu-14.04-tfs-2018-u3-docker-18.06.1-ceamd64No DockerfileUbuntu 14.0401/22/201901/22/2019
ubuntu-14.04-tfs-2018-u3-docker-18.06.1-ce-standardamd64No DockerfileUbuntu 14.0401/22/201901/22/2019

You can retrieve a list of all available tags for azure-pipelines/vsts-agent at https://mcr.microsoft.com/v2/azure-pipelines/vsts-agent/tags/list

Support

For support or general questions, please visit GitHub.

Feedback

Please direct all feedback to GitHub.

License

MICROSOFT SOFTWARE SUPPLEMENTAL LICENSE TERMS CONTAINER OS IMAGE Microsoft Corporation (or based on where you live, one of its affiliates) (referenced as “us,” “we,” or “Microsoft”) licenses this Container OS Image supplement to you (“Supplement”). You are licensed to use this Supplement in conjunction with the underlying host operating system software (“Host Software”) solely to assist running the containers feature in the Host Software. The Host Software license terms apply to your use of the Supplement. You may not use it if you do not have a license for the Host Software. You may use this Supplement with each validly licensed copy of the Host Software.

ADDITIONAL LICENSING REQUIREMENTS AND/OR USE RIGHTS Your use of the Supplement as specified in the preceding paragraph may result in the creation or modification of a container image (“Container Image”) that includes certain Supplement components. For clarity, a Container Image is separate and distinct from a virtual machine or virtual appliance image. Pursuant to these license terms, we grant you a restricted right to redistribute such Supplement components under the following conditions: (i) you may use the Supplement components only as used in, and as a part of, your Container Image, (ii) you may use such Supplement components in your Container Image as long as you have significant primary functionality in your Container Image that is materially separate and distinct from the Supplement; and (iii) you agree to include these license terms (or similar terms required by us or a hoster) with your Container Image to properly license the possible use of the Supplement components by your end-users. We reserve all other rights not expressly granted herein.

By using this Supplement, you accept these terms. If you do not accept them, do not use this Supplement.

As part of the Supplemental License Terms for this Container OS Image for Windows containers, you are also subject to the underlying Windows Server host software license terms, which are located at https://www.microsoft.com/en-us/useterms.

Docker Pull Command

docker pull mcr.microsoft.com/azure-pipelines/vsts-agent