docker-maven-plugin: Cannot build multiarch in CI using buildx and DMP 0.43.3
Description
While the new release 0.43.3 fixed the build problem on a Mac M1, it creates a new problem: multiarch builds using Buildx in a Github Action pipeline are no longer working after upgrading. Using an older version of the plugin, things are well in the CI (using 0.43.0 for quite some time now).
I see the following log entries from the runner. Here’s the complete log output.
[INFO] --- docker-maven-plugin:0.43.3:push (default-push) @ dataverse ---
[INFO] Expanding: /home/runner/work/dataverse/dataverse/target/docker/gdcc/dataverse/9771-fix-docker-build/tmp/docker-build.tar into /home/runner/work/dataverse/dataverse/target/docker/gdcc/dataverse/9771-fix-docker-build/tmp/docker-build
[INFO] DOCKER> docker buildx build --progress=plain --builder maven --platform linux/amd64,linux/arm64 --tag ghcr.io/gdcc/dataverse:9771-fix-docker-build --build-arg BASE_IMAGE=gdcc/base:unstable --file=/home/runner/work/dataverse/dataverse/target/docker/gdcc/dataverse/9771-fix-docker-build/tmp/docker-build/Dockerfile /home/runner/work/dataverse/dataverse/target/docker/gdcc/dataverse/9771-fix-docker-build/tmp/docker-build --push
[INFO] DOCKER> ERROR: no builder "maven" found
Error: DOCKER> Error status (1) when building
Info
- docker-maven-plugin version: 0.43.3
- Maven version (
mvn -v
) : Unknown, but recent (Github Runner provided) - Docker version : Unknown, but probably recent (GitHub Runner)
- If it’s a bug, how to reproduce : Not sure how to create a reproducer for this.
- Sample project : https://github.com/IQSS/dataverse/tree/9771-fix-docker-build
About this issue
- Original URL
- State: open
- Created a year ago
- Comments: 19 (10 by maintainers)
Commits related to this issue
- fix (buildx) : Change default value of buildx node to null (#1701) Signed-off-by: Rohan Kumar <rohaan@redhat.com> — committed to rohanKanojia/docker-maven-plugin by rohanKanojia 10 months ago
- fix (buildx) : Change default value of buildx node to null (#1701) Signed-off-by: Rohan Kumar <rohaan@redhat.com> — committed to rohanKanojia/docker-maven-plugin by rohanKanojia 10 months ago
- fix (buildx) : Change default value of buildx node to null (#1701) Signed-off-by: Rohan Kumar <rohaan@redhat.com> — committed to rohanKanojia/docker-maven-plugin by rohanKanojia 10 months ago
- fix (buildx) : Change default value of buildx node to null (#1701) Signed-off-by: Rohan Kumar <rohaan@redhat.com> — committed to rohanKanojia/docker-maven-plugin by rohanKanojia 10 months ago
- fix (buildx) : Change default value of buildx node to null (#1701) Signed-off-by: Rohan Kumar <rohaan@redhat.com> — committed to rohanKanojia/docker-maven-plugin by rohanKanojia 10 months ago
- fix (buildx) : Change default value of buildx node to null (#1701) Signed-off-by: Rohan Kumar <rohaan@redhat.com> — committed to rohanKanojia/docker-maven-plugin by rohanKanojia 10 months ago
- fix (buildx) : Always pass --config option for latest versions of Docker CLI (#1701) + Always pass --config option in case of latest docker + Change default value of --node parameter to null Signed-... — committed to rohanKanojia/docker-maven-plugin by rohanKanojia 10 months ago
- fix (buildx) : Always pass --config option for latest versions of Docker CLI (#1701) + Always pass --config option in case of latest docker + Change default value of --node parameter to null Signed-... — committed to rohanKanojia/docker-maven-plugin by rohanKanojia 10 months ago
- fix (buildx) : Always pass --config option for latest versions of Docker CLI (#1701) + Always pass --config option in case of latest docker + Change default value of --node parameter to null Signed-... — committed to rohanKanojia/docker-maven-plugin by rohanKanojia 10 months ago
- fix (buildx) : Always pass --config option for latest versions of Docker CLI (#1701) + Always pass --config option in case of latest docker + Change default value of --node parameter to null Signed-... — committed to rohanKanojia/docker-maven-plugin by rohanKanojia 10 months ago
- fix (buildx) : Always pass --config option for latest versions of Docker CLI (#1701) + Always pass --config option in case of latest docker + Change default value of --node parameter to null Signed-... — committed to rohanKanojia/docker-maven-plugin by rohanKanojia 10 months ago
- fix (buildx) : Always pass --config option for latest versions of Docker CLI (#1701) + Always pass --config option in case of latest docker + Change default value of --node parameter to null Signed-... — committed to rohanKanojia/docker-maven-plugin by rohanKanojia 10 months ago
- fix (buildx) : Always pass --config option for latest versions of Docker CLI (#1701) + Always pass --config option in case of latest docker + Change default value of --node parameter to null Signed-... — committed to fabric8io/docker-maven-plugin by rohanKanojia 10 months ago
- Revert docker-maven-plugin upgrade to 0.43.4 See #1695 This is caused by this change https://github.com/fabric8io/docker-maven-plugin/pull/1703 I tried a workaround but no luck. See in https://gith... — committed to dadoonet/fscrawler by dadoonet 8 months ago
- changing docker-maven-plugin version. see: https://github.com/fabric8io/docker-maven-plugin/issues/1701 — committed to dotCMS/core by wezell 7 months ago
Looks like this is due to difference in docker CLI versions. Newer docker CLIs require
--config
option to be added always. Older docker CLIs (20.x) seem to be having problems with passing--config
all the timeno. All I’m saying is, this problem seems to be related to the plugin only.
docker --config /Users/ABCD/github/sample-project/target/docker/dockerhub.com/sample-project/sample-artifact-id/1.0.2-SNAPSHOT-20230905134913/docker buildx create --driver docker-container --name maven --config /Users/ABCD/github/sample-project/target/docker/buildkit.toml [INFO] DOCKER> unknown flag: --driver [INFO] DOCKER> See 'docker --help'. [INFO] DOCKER> [INFO] DOCKER> Usage: docker [OPTIONS] COMMAND
In this above command generated, if I remove
--config
at the start of the line, the buildx instance is successfully getting created.Works like a charm in CI. Will respond later about status on the M1 machine where things failed before. Thanks a ton for fixing this @rohanKanojia ! Much appreciated!
@rohanKanojia thx for the reply. Here are some outputs as requested.
0.43.0, taken from https://github.com/IQSS/dataverse/actions/runs/5866182102/job/15904575945:
0.43.3, taken from https://github.com/IQSS/dataverse/actions/runs/5860235371/job/15888066573:
I’m spotting the difference that with 0.43.3, a parameter
--node maven0
is added which wasn’t present before and--config
is not added in the second run with multiple platforms. (Though it is added in the build phase…? 🤔 )