I am attempting to build an image and push it to my Docker repository using Jenkins with the CloudBees Docker Build and Push plugin. Everything goes smoothly until the push step, where it throws an access denied error
#9 exporting to image
#9 exporting layers done
#9 writing image sha256:1b570577ad93fa54e6b21aa26161c30e37bb04f5281c0d4eef5ab8209dca2f6f done
#9 naming to docker.io/iannisk13/jenkins-priv:14 done
#9 DONE 0.0s
[nodejs] $ docker build -t iannisk13/jenkins-priv:latest --pull=true /var/lib/jenkins/workspace/nodejs
WARNING: Support for the legacy ~/.dockercfg configuration file and file-format has been removed and the configuration file will be ignored
WARNING: Support for the legacy ~/.dockercfg configuration file and file-format has been removed and the configuration file will be ignored
#0 building with "default" instance using docker driver
#1 [internal] load build definition from Dockerfile
#1 transferring dockerfile: 538B done
#1 DONE 0.0s
#2 [internal] load metadata for docker.io/library/openjdk:8-jre-alpine
#2 DONE 0.2s
#3 [internal] load .dockerignore
#3 transferring context: 2B done
#3 DONE 0.0s
#4 [1/4] FROM docker.io/library/openjdk:8-jre-alpine@sha256:f362b165b870ef129cbe730f29065ff37399c0aa8bcab3e44b51c302938c9193
#4 DONE 0.0s
#5 [internal] load build context
#5 transferring context: 84B done
#5 DONE 0.0s
#6 [2/4] RUN apk update && apk add bash
#6 CACHED
#7 [3/4] WORKDIR /app
#7 CACHED
#8 [4/4] COPY /target/docker-java-app-example.jar /app
#8 CACHED
#9 exporting to image
#9 exporting layers done
#9 writing image sha256:1b570577ad93fa54e6b21aa26161c30e37bb04f5281c0d4eef5ab8209dca2f6f done
#9 naming to docker.io/iannisk13/jenkins-priv:latest done
#9 DONE 0.0s
[nodejs] $ docker push iannisk13/jenkins-priv:14
The push refers to repository [docker.io/iannisk13/jenkins-priv]
d5caf78762ac: Preparing
cdcb03e8c3e6: Preparing
fa63a7b7ab1d: Preparing
edd61588d126: Preparing
9b9b7f3d56a0: Preparing
f1b5933fe4b5: Preparing
f1b5933fe4b5: Waiting
denied: requested access to the resource is denied
Build step 'Docker Build and Publish' marked build as failure
Finished: FAILURE
I have tried to log in and push manually from my Jenkins host, and everything works fine. I have recreated and checked my credentials for login many times, which are saved in Jenkins. I have already been struggling with this issue for hours and have reached a dead end.
Could it be that the plugin is just outdated? The last update was 1.5 years ago.
Also, I can't understand where this error is coming from. Maybe it's related to the issue?
WARNING: Support for the legacy ~/.dockercfg configuration file and file format has been removed, and the configuration file will be ignored.