jenkinsci / jenkinsci/docker-workflow-plugin

[JENKINS-59777] nested docker.withRegistry() does not work

Open
#628 9 comments 0 reactions 0 assignees View on GitHub
component:docker-commons-plugin component:docker-workflow-plugin imported-jira-issue priority:minor resolution:unresolved
Dominant language
Java
Stars
527
Forks
422
Avg merge
10m
Merged PRs (30d)
1

Description

With the previous behavior of docker-workflow-plugin (1.15) I was able to nest my `docker.withRegistry()` calls so I can access numerous registries at the same time.

Example: 

node('docker') {

docker.withRegistry('https://repo1.private.com', '5d243c54-3d2c-42e3-9c3d-35c1cbe61ddd') {
docker.withRegistry('https://repo2.private.com', '5d243c54-3d2c-42e3-9c3d-35c1cbe61ddd') {
sh('docker pull repo1/library/image:latest')
sh('docker pull repo2/libraryimage:latest')
}
}
}

From the output it looks like each credential is stored in it's own file per registry. My assumption is that with nested logins, it should be in the same credential store/file?

Is there any workaround for this?

 


---
Originally reported by arty13, imported from: nested docker.withRegistry() does not work


  • assignee: jglick
  • status: In Review
  • priority: Minor
  • component(s): docker-commons-plugin, docker-workflow-plugin
  • resolution: Unresolved
  • votes: 5
  • watchers: 7
  • imported: 2025-12-07

Raw content of original issue

With the previous behavior of docker-workflow-plugin (1.15) I was able to nest my `docker.withRegistry()` calls so I can access numerous registries at the same time.

Example: 



node('docker') {

docker.withRegistry('https://repo1.private.com', '5d243c54-3d2c-42e3-9c3d-35c1cbe61ddd') {
docker.withRegistry('https://repo2.private.com', '5d243c54-3d2c-42e3-9c3d-35c1cbe61ddd') {
sh('docker pull repo1/library/image:latest')
sh('docker pull repo2/libraryimage:latest')
}
}
}


From the output it looks like each credential is stored in it's own file per registry. My assumption is that with nested logins, it should be in the same credential store/file?

Is there any workaround for this?

 



environment

```
Jenkins 2.190.1

docker-workflow-plugin 1.21

docker-commons 1.15
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.