docker-maven-plugin: With 0.43.2 push to Docker Hub is not working any more

Description

The Jenkins job which pushes Apache Syncope images to Docker Hub started failing after upgrading the docker-maven-plugin from 0.43.0 to 0.43.2.

Sample job output: https://ci-builds.apache.org./job/Syncope/job/Syncope-3_0_X-deploy/203/console

DockerHub credentials are stored under ~/.m2/settings.xml

Info

  • docker-maven-plugin version : 0.43.2
  • Maven version (mvn -v) : 3.6.3

  • Docker version :
  • If it’s a bug, how to reproduce :
  • If it’s a feature request, what is your use case :
  • Sample project : [GitHub Clone URL]

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 16 (6 by maintainers)

Commits related to this issue

Most upvoted comments

Also running into this problem with ghcr.io and 0.43.2, this setup was working with 0.43.0 and earlier

Maven settings: https://github.com/B3Partners/tailormap-api/blob/7126ebe39a2c3470a7b247cbf91ef4a01a29c675/.github/maven-settings.xml#L7-L17

pom/config: https://github.com/B3Partners/tailormap-api/blob/7126ebe39a2c3470a7b247cbf91ef4a01a29c675/pom.xml#L1148-L1198

credentials are set from secrets as env variables in: https://github.com/B3Partners/tailormap-api/blob/7126ebe39a2c3470a7b247cbf91ef4a01a29c675/.github/workflows/ubuntu-maven.yml#L168-L178

typical build log:

[INFO] DOCKER> #14 exporting to image
[INFO] DOCKER> #14 exporting layers
[INFO] DOCKER> #14 exporting layers 4.4s done
[INFO] DOCKER> #14 exporting manifest sha256:685cf37b6a2bcbf52f63925608334cf2a59a1a9346f8957ba15c5026944e13c0 done
[INFO] DOCKER> #14 exporting config sha256:0482d55d2176e7e51e1378220a96626bacdcb62be88744dc2130f7a8d2ce06df done
[INFO] DOCKER> #14 exporting manifest sha256:5b17d756175ab7e8136cbcf5f83d03bd3b2b49633630fb3ba9ba3f9bc19e5937 done
[INFO] DOCKER> #14 exporting config sha256:34af804fd992fdb8d0360bcb5cc76f9bade06f7ea450d13730055c4726d93c16 done
[INFO] DOCKER> #14 exporting manifest list sha256:54e915e59920901da68737bd99698f21df4f484f5cc3759a16551084bea035dd done
[INFO] DOCKER> #14 pushing layers
[INFO] DOCKER> #14 pushing layers 0.3s done
[INFO] DOCKER> #14 ERROR: failed to push ghcr.io/b3partners/tailormap-api:snapshot: failed to authorize: failed to fetch anonymous token: unexpected status from GET request to https://ghcr.io/token?scope=repository%3Ab3partners%2Ftailormap-api%3Apull%2Cpush&service=ghcr.io: 403 Forbidden
[INFO] DOCKER> ------
[INFO] DOCKER>  > exporting to image:
[INFO] DOCKER> ------
[INFO] DOCKER> ERROR: failed to solve: failed to push ghcr.io/b3partners/tailormap-api:snapshot: failed to authorize: failed to fetch anonymous token: unexpected status from GET request to https://ghcr.io/token?scope=repository%3Ab3partners%2Ftailormap-api%3Apull%2Cpush&service=ghcr.io: 403 Forbidden
Error:  DOCKER> Error status (1) when building
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  03:04 min (Wall Clock)
[INFO] Finished at: 2023-08-08T09:50:24Z
[INFO] ------------------------------------------------------------------------
Error:  Failed to execute goal io.fabric8:docker-maven-plugin:0.43.2:push (docker-push) on project tailormap-api: Error status (1) when building -> [Help 1]

0.43.3 works for me

I confirm that 0.43.3 is working fine for me as well, thank you very much @rohanKanojia

With 0.43.2:

docker buildx build --progress=plain --builder maven --platform linux/amd64,linux/arm64 --tag apache/syncope:3.0.5-SNAPSHOT --file=/home/jenkins/jenkins-agent/workspace/Syncope/Syncope-3_0_X-deploy/docker/core/target/docker/apache/syncope/3.0.5-SNAPSHOT/tmp/docker-build/Dockerfile /home/jenkins/jenkins-agent/workspace/Syncope/Syncope-3_0_X-deploy/docker/core/target/docker/apache/syncope/3.0.5-SNAPSHOT/tmp/docker-build --push

With 0.43.0:

docker --config /home/jenkins/workspace/Syncope/Syncope-3_0_X-deploy/docker/core/target/docker/apache/syncope/3.0.5-SNAPSHOT/docker buildx build --progress=plain --builder maven --platform linux/amd64,linux/arm64 --tag apache/syncope:3.0.5-SNAPSHOT --file=/home/jenkins/workspace/Syncope/Syncope-3_0_X-deploy/docker/core/target/docker/apache/syncope/3.0.5-SNAPSHOT/tmp/docker-build/Dockerfile /home/jenkins/workspace/Syncope/Syncope-3_0_X-deploy/docker/core/target/docker/apache/syncope/3.0.5-SNAPSHOT/tmp/docker-build --push

@rohanKanojia the reported error is

DOCKER> #44 ERROR: failed to push apache/syncope:3.0.5-SNAPSHOT: push access denied, repository does not exist or may require authorization: server message: insufficient_scope: authorization failed

The plugin configuration can be found at https://github.com/apache/syncope/blob/3_0_X/docker/core/pom.xml#L237-L273