Reputation: 5082
The azure agent is usually used as follows, it is named as pool and with a VM image title
pool:
vmImage: 'ubuntu-16.04'
Can a hosted agent in azure DevOps service be considered as a container in VM managed by azure DevOps service?
Upvotes: 0
Views: 1174
Reputation: 18978
Can a hosted agent in azure DevOps service be considered as a container in VM managed by azure DevOps service?
Restrictly to say, no, you can not.
The key words of vmImage
not point to a container, it just an image of a virtual machine, a copy of the VM. This copy contain an OS, data files, and some built-in applications we pre-configured to facilitate user use.
If you want to do some Container jobs along with Hosted agents, here the suggestion of Eldho is available. Note: As of today, the container jobs only support YAML pipeline.
Or, you can get our containerized agents image from Docker hub. But this is a self agent type.
Upvotes: 1
Reputation: 8273
Your Yaml will be run on VM
Azure pipelines can run in VM or container.
Each time you run a Azure pipeline, you get a fresh virtual machine. The virtual machine is discarded after one use. Microsoft-hosted agents can run jobs directly on the VM or in a container.
A container Yaml
pool:
vmImage: 'ubuntu-16.04'
container: ubuntu:16.04
steps:
- script: printenv
This tells the system to fetch the ubuntu image tagged 16.04 from Docker Hub and then start the container. When the printenv command runs, it will happen inside the ubuntu:16.04 container.
Upvotes: 2