Azure DevOps Self-Hosted Linux Agent. General purpose Docker image with pre-installed tools.
Goals:
- Run anywhere
- Auto scalable
- Self-configurable
- Feature rich
- Customizable
Bundled tools:
- Docker-in-Docker
- Azure CLI (azure-devops & resource-graph extensions)
- AWS CLI
- Powershell
- Azure Powershell modules
- AWS Tools for PowerShell (bundle)
- Kubectl
- Kubelogin
- Kustomize
- Helm
- JQ & YQ
- Terraform
- Terraspace
Supported --build-arg
variables are listed below to easily configure the agent image based on your requirements. All options default to 1 (enabled).
ADD_DOCKER
: Installs Docker for Docker-in-Docker supportADD_AZURE_CLI
: Installs Azure-CLIADD_AWS_CLI
: Installs AWS-CLIADD_POWERSHELL
: Installs PowershellADD_AZURE_PWSH_CLI
: Installs Azure Powershell modules, if Powershell is also enabledADD_AWS_PWSH_CLI
: Installs AWS Powershell modules, if Powershell is also enabledADD_KUBECTL
: Installs Kuberneteskubectl
ADD_KUBELOGIN
: Installs Kuberneteskubelogin
for Azure authenticationADD_KUSTOMIZE
: Installs Kuberneteskustomize
toolADD_HELM
: InstallsHelm
toolADD_JQ
: Installsjq
toolADD_YQ
: Installsyq
toolADD_TERRAFORM
: Installsterraform
toolADD_TERRASPACE
: Installsterraspace
toolADD_SUDO
: Installs and enablessudo
for the agent user group
https://github.com/Microsoft/azure-pipelines-agent/
https://hub.docker.com/r/fok666/azuredevops
https://docs.microsoft.com/azure/devops/pipelines/agents/docker?view=azure-devops
This agent is intended to run on virtual machines.
To be able to build Docker images with the agent, docker must be installed on the host and allowed to run in privileged mode.
# Docker install:
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=$(dpkg --print-architecture)] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get update -y
sudo apt-get install -y docker-ce docker-ce-cli containerd.io
# Docker startup:
sudo systemctl start docker
sudo systemctl enable docker
# Get the agent startup, stop and monitor scripts and make them executable:
sudo curl -sO https://raw.githubusercontent.com/fok666/azure-devops-agent/main/run.sh
sudo curl -sO https://raw.githubusercontent.com/fok666/azure-devops-agent/main/monitor.sh
sudo curl -sO https://raw.githubusercontent.com/fok666/azure-devops-agent/main/stop.sh
sudo chmod +x *.sh
# Set the parameters from Azure DevOps:
export ORG_URL="https://dev.azure.com/YOUR_ORG"
export DEVOPS_PAT="xxxxxxxxxxxxxxxxxxxxxxxxxxx"
export AGENT_POOL_NAME="YourLinuxAgentPool"
# Start the agents in privileged mode, one agent for each vCPU, using the parameters above:
sudo ./run.sh fok666/azuredevops:latest $ORG_URL $DEVOPS_PAT $AGENT_POOL_NAME
This project is designed to use Azure Virtual Machine Scale Sets, but can be used with different settings.
monitor.sh
: Add this script to the host's cron to monitor VMSS shutdown events. Requirescurl
andjq
.stop.sh
: Add this script to/opt/stop.sh
to enable graceful Agent shutdown. Requires SUDO.
- Add Google Compute Cloud (GCP) CLI bundles
- Add GKE auth support