Sign inSign up

culturedevops/simple-azp-agent-docker-dind

By culturedevops

•Updated almost 2 years ago

Simple Azure Devops Pipelines Agent Docker-in-Docker Image

Image
Integration & delivery
1

1.4K

culturedevops/simple-azp-agent-docker-dind repository overview

⁠Simple Azure Devops Pipelines Agent Docker-in-Docker Image

The most simple Docker-in-Docker Azure Devops Pipelines Agent image for self-hosted agents. It is based on Docker:dind Official Image⁠. This image can run on either Linux or Windows (Docker Desktop), you just have to use the related docker-compose file.

See my Github repository https://github.com/CultureDevOps/simple-azp-agent-docker-dind⁠

⁠Usage

⁠Running the Image for Linux

Sample docker-compose file :

version: "3.8"

services:
  dind:
    image: culturedevops/simple-azp-agent-docker-dind:latest
    tty: true
    restart: unless-stopped
    volumes:
      - "/var/run/docker.sock:/var/run/docker.sock"
    environment:
      AZP_URL: "https://dev.azure.com/youraccount"
      AZP_AGENT_NAME: "azure-agent-desktop"
      AZP_POOL: "azure-agent"
      AZP_TOKEN: "Your Token Here"

⁠Running the Image for Windows

Sample docker-compose file :

version: "3.8"

services:
  dind:
    image: culturedevops/simple-azp-agent-docker-dind:latest
    tty: true
    restart: unless-stopped
    volumes:
      - "//var/run/docker.sock:/var/run/docker.sock"
    group_add:
      - "0"
    environment:
      AZP_URL: "https://dev.azure.com/youraccount"
      AZP_AGENT_NAME: "azure-agent-desktop"
      AZP_POOL: "azure-agent"
      AZP_TOKEN: "Your Token Here"

In docker-compose-windows.yml you can note 2 things :

  • To bind the volume /var/run/docker.sock we use a leading double slash "//" as it is required to address the Docker socket on the host.
  • To run the container as a non-root user and avoid permission issue we add the group 0 to the user.
⁠Environment Variables

AZP_URL: The URL of the Azure DevOps or Azure DevOps Server instance.

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.

AZP_AGENT_NAME : Agent name (default value: the container hostname).

AZP_POOL : Agent pool name (default value: Default).

AZP_WORK : Work directory (default value: _work).

See https://learn.microsoft.com/en-us/azure/devops/pipelines/agents/docker?view=azure-devops⁠

Tag summary

Content type

Image

Digest

sha256:6a03509c4…

Size

136.1 MB

Last updated

almost 2 years ago

docker pull culturedevops/simple-azp-agent-docker-dind