{"id":22428528,"url":"https://github.com/kwame-mintah/azuredevops-selfhosted-agents-docker-compose","last_synced_at":"2026-05-01T01:31:37.180Z","repository":{"id":106960010,"uuid":"549213200","full_name":"kwame-mintah/azuredevops-selfhosted-agents-docker-compose","owner":"kwame-mintah","description":"Example for running self-hosted azure devops agents using docker-compose.","archived":false,"fork":false,"pushed_at":"2023-12-04T19:33:35.000Z","size":20,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-27T06:45:12.296Z","etag":null,"topics":["azure-devops","azure-devops-agent","docker-compose","docker-compose-template","example-code","example-project"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kwame-mintah.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-10-10T21:13:40.000Z","updated_at":"2022-10-10T21:18:00.000Z","dependencies_parsed_at":"2023-12-04T20:44:47.994Z","dependency_job_id":null,"html_url":"https://github.com/kwame-mintah/azuredevops-selfhosted-agents-docker-compose","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kwame-mintah/azuredevops-selfhosted-agents-docker-compose","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kwame-mintah%2Fazuredevops-selfhosted-agents-docker-compose","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kwame-mintah%2Fazuredevops-selfhosted-agents-docker-compose/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kwame-mintah%2Fazuredevops-selfhosted-agents-docker-compose/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kwame-mintah%2Fazuredevops-selfhosted-agents-docker-compose/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kwame-mintah","download_url":"https://codeload.github.com/kwame-mintah/azuredevops-selfhosted-agents-docker-compose/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kwame-mintah%2Fazuredevops-selfhosted-agents-docker-compose/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32482460,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"ssl_error","status_checked_at":"2026-04-30T13:12:06.837Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["azure-devops","azure-devops-agent","docker-compose","docker-compose-template","example-code","example-project"],"created_at":"2024-12-05T20:15:07.393Z","updated_at":"2026-05-01T01:31:37.172Z","avatar_url":"https://github.com/kwame-mintah.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Azure Devops Self-Hosted Agents Docker-Compose\n\nLaunch self-hosted agents in Azure DevOps using docker-compose. Although a guide has been provided for [self-hosted in Docker](https://learn.microsoft.com/en-us/azure/devops/pipelines/agents/docker?view=azure-devops), there isn't an example available for running using docker-compose. This repository aims to provide an example of how to accomplish this.\n\n## Prerequisites\n\n1. Have [Docker for desktop](https://www.docker.com/products/docker-desktop) installed on your machine,\n2. Have permission to configure agents within your Azure DevOps organisation.\n\n## Usage\n\n1. Clone the repository and navigate to the directory,\n2. Copy `.env.example` and create a new `.env` file and assign environment variable values,\n3. Build and start the agents / services with:\n\n   `docker compose -f docker-compose.example.yml up -d`,\n\n4. Stop all agents / services:\n\n   `docker compose -f docker-compose.example.yml down --remove-orphans`.\n\nStarting the services will launch one agent and one deployment agent and should be available for usage, within their respective pools.\n\n\u003e [!NOTE]\n\u003e\n\u003e If you would like to force a re-build of the docker image add `--build` when starting the services e.g.\n\u003e `docker compose -f docker-compose.example.yml up --build -d`\n\n## Environment variables\n\nThe following environment variables are used for the services, additionally, all environment variables used by the agent can be [found here](https://learn.microsoft.com/en-us/azure/devops/pipelines/agents/docker?view=azure-devops#environment-variables).\n\n| Environment variable | Description                                                                                                                              | Default value          | Required? |\n| -------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------- | --------- |\n| AZP_URL              | The URL of the Azure DevOps or Azure DevOps Server instance.                                                                             | N/A                    | Yes       |\n| AZP_TOKEN            | Personal Access Token (PAT) with Agent Pools (read, manage) scope, created by a user who has permission to configure agents, at AZP_URL. | N/A                    | Yes       |\n| AZP_AGENT_NAME       | Agent name.                                                                                                                              | The container hostname | Optional  |\n| AZP_POOL             | Agent pool name.                                                                                                                         | Default                | Optional  |\n| AZP_WORK             | Work directory                                                                                                                           | `_work`                | No        |\n| DEPLOYMENT_AGENT     | Indicate if the agent should be configured as a deployment agent by setting the value as `\"true\"`                                        | N/A                    | Optional  |\n| DEPLOYMENT_POOLNAME  | The deployment pool that the agent should be added to, if `DEPLOYMENT_AGENT` value is `\"true\"`                                           | N/A                    | Optional  |\n\nNote: `AZP_POOL` does not need to be specified, if the agent is a deployment agent. But instead a valid deployment pool must already be created within the organisation.\n\n## Installing additionally command line utilities\n\nIf you're running into issues installing additional command line tools through your pipeline. It's possible to update the `Dockerfile` to install the tool during the docker build\nof the image. For example [ArchiveFiles@2](https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/reference/archive-files-v2?view=azure-pipelines) may fail due to `zip` due\nto command not found error, in which case you can add it to the list of `apt-get install` so you can use the `zip` command with the Azure Pipeline task.\n\nThe proposed option assumes that that all agents need `zip` cli installed. Alternatively, If there is only one job that requires a command, you can install it via bash script in the pipeline e.g. `apt-get install zip -y --allow-change-held-packages`, this should download and install the cli.\n\n\n## Failed to fetch packages during job run\n\nWhen attempting to fetch new *or* updated packages during a job run but fails due to:\n```console\nErr:4 http://ports.ubuntu.com/ubuntu-ports focal-updates/main arm64 binutils-common arm64 2.34-6ubuntu1.5\n  404  Not Found [IP: 185.125.190.36 80]\n```\nThis happens because a cached Docker is used. The cached image wouldn't have the latest repository information and requires having to rebuild the image again.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkwame-mintah%2Fazuredevops-selfhosted-agents-docker-compose","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkwame-mintah%2Fazuredevops-selfhosted-agents-docker-compose","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkwame-mintah%2Fazuredevops-selfhosted-agents-docker-compose/lists"}