Details
-
Type:
Bug
-
Status: Resolved (View Workflow)
-
Priority:
Minor
-
Resolution: Fixed
-
Component/s: docker-commons-plugin
-
Labels:None
-
Environment:Jenkins 2.20
OpenJDK 1.8.0_92
docker-commons 1.5
docker-workflow 1.9
-
Similar Issues:
Description
This issue was discovered in the docker-workflow-plugin, which has a dependency on docker-commons-plugin.
Given the following pipeline code:
docker.withRegistry('http://localhost:5000/') { def dockerImage = docker.image('localhost:5000/test-image') dockerImage.inside { echo "container running on ${port}" } }
The rendered "docker pull" command incorrectly formats the qualified image name as:
localhost:5000/localhost:5000/test-image
I have submitted a PR that adds a condition to check whether or not the image name already contains the registry prefix to avoid appending again.
Attachments
Issue Links
- is duplicated by
-
JENKINS-40962 docker Image.push doesn't work using withRegistry
-
- Resolved
-
Code changed in jenkins
User: Oleg Nenashev
Path:
src/main/java/org/jenkinsci/plugins/docker/commons/credentials/DockerRegistryEndpoint.java
src/test/java/org/jenkinsci/plugins/docker/commons/credentials/DockerRegistryEndpointTest.java
http://jenkins-ci.org/commit/docker-commons-plugin/8edbc8ed06d2f9164fd00fe9be9cf39fa4dd78f8
Log:
Merge pull request #56 from liebowitz/master
JENKINS-39181Invalid fully qualified image name when registry URL specifiedCompare: https://github.com/jenkinsci/docker-commons-plugin/compare/9d298f88b30b...8edbc8ed06d2