Azure DevOps Self-hosted Linux Agent on Azure Container Instance


By default, Azure DevOps pipeline runs on Microsoft-hosted agent.
Every time the pipeline runs, it takes long time to install middleware (usually 5minutes+)

Microsoft provides the other way to avoid these wasted time, “Self-hosted” agent.
“Self-hosted” agent is provided with configurable Dockerfile and .sh.
So, configured “self-hosted” image run on VM or ACI provides “Job runner” environment.

I tried to set up “Self-hosted” Linux agent and configured ACI/ACR to run the agent.

ref. Use Running Azure Container Instance in Azure Pipeline


x86 mac and Docker desktop.

Build Self-hosted Linux agent

see Create and build the Dockerfile

Make workdir on mac and Dockerfile, entry script.

Dockerfile is as follows.

Entry script ( is as follows.

Build image.
AZP_URL is Azure DevOps organization url. ({organization} ) .
AZP_TOKEN is Personal Access Token for DevOps. ( full access for simplicity ) .
AZP_AGENT_NAME is ID on DevOps ( ex. mydockeragent ).

“Running Azure Pipelines agent” on Mac connects to Azure DevOps Pipeline.
then waits for running job.

to be continued…


Copyright© , 2023 AllRights Reserved Powered by AFFINGER4.