microsoft / azure-pipelines-agent

Azure Pipelines Agent 🚀
MIT License
1.73k stars 869 forks source link

[enhancement]: Add localImage option for job containers #5014

Open npalmius opened 1 month ago

npalmius commented 1 month ago

Describe your feature request here

When specifying a container in a resource, (e.g. resources.containers.container) there is a localImage option to use locally cached images rather than pulling from the repository (we are using self-hosted agents, so we pull the images that we need locally when building the agent).

However, we are using a lot of nested templates in our setup, so we define the container directly in the job (e.g. using a jobs.job.container: image definition).

This definition does not have all of the options from the resources.containers.container definition, and in particular the localImage option.

Would it be possible to add the ability to specify the localImage option in job container objects?

Note that trying to specify localImage for a jobs.job.container results in the following error:

(Line: 52, Col: 9): Unexpected value