Registry Credentials Not Used To Pull (build step)
See original GitHub issueJobs that are configured to use a “Build / Publish Docker Image” build step with registry credentials do not appear to be using the credentials when pulling the parent image (the “FROM” in the Dockerfile).
Plugin version: 1.1.1 Jenkins version: 2.89.2 Docker version: 1.13.1 Docker API Jenkins plugin version: 3.0.14
Console output says:
15:43:06 Docker Build
15:43:06 Docker Build: building image at path /var/lib/jenkins/workspace/docker-image-build-step/wf-httpd-base
15:43:06 Step 1/11 : FROM my.private.registry:5443/wf/wf-os-base:latest
15:43:06
15:43:06 ERROR: Build step failed with exception
15:43:06 com.github.dockerjava.api.exception.DockerClientException: Could not build image: unauthorized: authentication required
15:43:06 at com.github.dockerjava.core.command.BuildImageResultCallback.getImageId(BuildImageResultCallback.java:79)
15:43:06 at com.github.dockerjava.core.command.BuildImageResultCallback.awaitImageId(BuildImageResultCallback.java:51)
15:43:06 at com.nirima.jenkins.plugins.docker.builder.DockerBuilderPublisher$Run.buildImage(DockerBuilderPublisher.java:353)
15:43:06 at com.nirima.jenkins.plugins.docker.builder.DockerBuilderPublisher$Run.run(DockerBuilderPublisher.java:286)
15:43:06 at com.nirima.jenkins.plugins.docker.builder.DockerBuilderPublisher.perform(DockerBuilderPublisher.java:423)
15:43:06 at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:81)
15:43:06 at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
15:43:06 at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744)
15:43:06 at hudson.model.Build$BuildExecution.build(Build.java:206)
15:43:06 at hudson.model.Build$BuildExecution.doRun(Build.java:163)
15:43:06 at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:504)
15:43:06 at hudson.model.Run.execute(Run.java:1724)
15:43:06 at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
15:43:06 at hudson.model.ResourceController.execute(ResourceController.java:97)
15:43:06 at hudson.model.Executor.run(Executor.java:421)
15:43:06 Build step 'Build / Publish Docker Image' marked build as failure
I’m not sure if the plugin is passing the credentials to the API plugin or not. If it is and the issue is really withe API plugin please let me know and I’ll open the issue over there.
Issue Analytics
- State:
- Created 6 years ago
- Comments:15 (8 by maintainers)
Top Results From Across the Web
Using Docker Image Registries - CloudBees Documentation
Registry Authentication. If you are using private images, you will need to authenticate with the image registries to pull and push from your...
Read more >docker login - Docker Documentation
docker login: Login to a registry. ... Log in to a Docker registry ... The default credential store ( credsStore or the config...
Read more >Troubleshooting errors with Docker commands when using ...
Some versions of Docker for Windows use a credential manager called wincred , which does not properly handle the Docker login command produced...
Read more >Troubleshoot registry login - Azure - Microsoft Docs
Check Docker configuration · Specify correct registry name · Confirm credentials to access registry · Confirm credentials are authorized to access ...
Read more >Push and pull images | Artifact Registry documentation
Artifact Registry does not automatically add all registry hosts to the Docker ... If you used gcloud auth configure-docker or docker-credential-gcr ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Thank you very much for this
@ndeloof Looks like it’s not meant to work with custom registries – https://github.com/jenkinsci/docker-plugin/blob/15b66d7dabe3298e51544caf136ed732ecdb2b76/src/main/java/com/nirima/jenkins/plugins/docker/DockerTemplateBase.java#L422
It always pass null for the registry url.
Is there a way to use custom registry in Docker Template?
Thank you.