fabric8io / docker-maven-plugin

Maven plugin for running and creating Docker images
https://dmp.fabric8.io
Apache License 2.0
1.88k stars 643 forks source link

Multi-Platform build fails with OrbStack on MacOS #1710

Open elektro-wolle opened 1 year ago

elektro-wolle commented 1 year ago

Description

I'm using OrbStack instead of Docker-Desktop on MacOS, which seems to be more picky on the order of the command-line arguments of docker buildx:

$  mvn install
[INFO] Scanning for projects...
[INFO] 
[INFO] -------------< de.elektrowolle.sample:maven-multiplatform >-------------
[INFO] Building maven-multiplatform 0.0.1-SNAPSHOT
[INFO]   from pom.xml
[INFO] --------------------------------[ pom ]---------------------------------
[INFO] 
[INFO] --- docker:0.43.0:build (default) @ maven-multiplatform ---
[INFO] Building tar: /Users/wolle/workspace-polyas/polyas-project/docker-maven-plugin-orbstack-issue/target/docker/de.elektrowolle.sample/maven-multiplatform/0.0.1-SNAPSHOT/tmp/docker-build.tar
[INFO] DOCKER> [de.elektrowolle.sample/maven-multiplatform:0.0.1-SNAPSHOT]: Created docker-build.tar in 16 milliseconds
[INFO] DOCKER> docker --config /Users/wolle/workspace-polyas/polyas-project/docker-maven-plugin-orbstack-issue/target/docker/de.elektrowolle.sample/maven-multiplatform/0.0.1-SNAPSHOT/docker buildx create --driver docker-container --name maven
[INFO] DOCKER> unknown flag: --driver
[INFO] DOCKER> See 'docker --help'.
[INFO] DOCKER> 
...

According to docker buildx create --help (which differs from DockerDesktop), the config flag seems to be allowed only after docker buildx create:

 $  docker buildx create --help

Usage:  docker buildx create [OPTIONS] [CONTEXT|ENDPOINT]

Create a new builder instance

Options:
      --append                   Append a node to builder instead of changing it
      --bootstrap                Boot builder after creation
      --buildkitd-flags string   Flags for buildkitd daemon
      --config string            BuildKit config file
      --driver string            Driver to use (available: "docker-container", "kubernetes", "remote")
      --driver-opt stringArray   Options for the driver
      --leave                    Remove a node from builder instead of changing it
      --name string              Builder instance name
      --node string              Create/modify node with given name
      --platform stringArray     Fixed platforms for current node
      --use                      Set the current builder instance

Info

peschee commented 1 year ago

Possibly related to (or a duplicate of) #1701?

elektro-wolle commented 1 year ago

Closed as duplicate.