When using an agent directive in Declarative Pipeline there is no way to specify the Docker Registry to use. In Scripted Pipline this is available via the withRegistry wrapper
For Declarative we should allow admins to create a default registry to be used by all Pipelines at the master level or the folder level. We should also allow a specific registry setting in the language itself via the agent directive.
would something like that work? or the docker item take a block in that case with all the config needed? (Andrew would be able to comment on what is best)
Hrm. I don't like the idea of mixing closures with string values in the agent config. That ship has already sailed, I think. I'll play around with it, but I don't think it'll work well. Most likely, we'll need straight key/value pairings.
I tell a lie - there's no viable way to fit non- closure{{String}} {{agent}} values into the AST. Grr. We *could* do maps, though. So I'd lean towards this syntax:
Current syntax looks like this withDockerRegistry([credentialsId: 'foo', url: 'https://docker.foo.com']). Tried to add it as wrapper but obviously that didn't work out.
Maybe the agent syntax always needs to be a closure, away from strings. In the future there might be a lot of parameters for different kinds of agents.