docker-plugin: Registry Credentials Not Used To Pull (build step)
Jobs 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.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 15 (8 by maintainers)
Thank you very much for this