docker-maven-plugin: Multi-platform buildx: unauthorized for fetching metadata for the base image
Description
Using the plugin to run multi-platform builds via buildx fails to get the meta-data of base images, if the base image is located at a registry which needs authentication. The registry is configured in settings.xml.
Info
- docker-maven-plugin version : 0.40.1
- Maven version (
mvn -v
) :
Maven home: /opt/homebrew/Cellar/maven/3.8.5/libexec
Java version: 11.0.15, vendor: Homebrew, runtime: /opt/homebrew/Cellar/openjdk@11/11.0.14.1/libexec/openjdk.jdk/Contents/Home
Default locale: en_AT, platform encoding: UTF-8
OS name: "mac os x", version: "12.4", arch: "aarch64", family: "mac"
- Docker version : 20.10.13
- If it’s a bug, how to reproduce : Build a multi-platform image with a base image from a private registry.
Sample output:
[INFO] DOCKER> #4 [linux/amd64 internal] load metadata for myregistry.example.com/openjdk:8-jre-slim
[INFO] DOCKER> #4 ERROR: pulling from host myregistry.example.com failed with status code [manifests 8-jre-slim]: 401 Unauthorized
[INFO] DOCKER>
[INFO] DOCKER> #5 [linux/arm64 internal] load metadata for myregistry.example.com/openjdk:8-jre-slim
[INFO] DOCKER> #5 ERROR: pulling from host myregistry.example.com failed with status code [manifests 8-jre-slim]: 401 Unauthorized
Using docker buildx directly on the command-line works.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 18 (6 by maintainers)
Commits related to this issue
- #1583 remove --config from command string generation — committed to robfrank/docker-maven-plugin by robfrank a year ago
- #1583 remove --config from command string generation Signed-off-by: Roberto.Franchini <ro.franchini@gmail.com> — committed to robfrank/docker-maven-plugin by robfrank a year ago
- #1583 remove --config from command string generation add --node option to buildx command Signed-off-by: Roberto.Franchini <ro.franchini@gmail.com> — committed to robfrank/docker-maven-plugin by robfrank a year ago
- #1583 remove --config from command string generation add --node option to buildx command Signed-off-by: Roberto.Franchini <ro.franchini@gmail.com> — committed to robfrank/docker-maven-plugin by robfrank a year ago
- #1583 remove --config from command string generation add --node option to buildx command Signed-off-by: Roberto.Franchini <ro.franchini@gmail.com> — committed to fabric8io/docker-maven-plugin by robfrank a year ago
I can provide a PR with this two fixes to the project today or tomorrow
Hi @rohanKanojia, for my purpose 0.43.2 seems to work as expected. the --config parameter is no longer present, and therefor a local docker login is sufficient to let the plugin build multi-arch images and push them to a registry with authentication.
thanks you very much.
I’m facing a similar problem. In
samples/multi-architecture
when building the project :If I remove the
--confg /path
all works fine. So I modified this line: https://github.com/fabric8io/docker-maven-plugin/blob/043a5698b1408e3a1a95a2e84dfed08da2ec5b24/src/main/java/io/fabric8/maven/docker/service/BuildXService.java#L66to:
And the samples/multi-architecture is working fine. Is this
--config
needed? To me, it looks like the bouldX service is mixing docket config and buildx config.Final note, my versions