Skip to content
This repository has been archived by the owner on Jun 19, 2024. It is now read-only.

build error [125] on mac M2 #1842

Closed
janpauldahlke opened this issue Jun 7, 2023 · 5 comments
Closed

build error [125] on mac M2 #1842

janpauldahlke opened this issue Jun 7, 2023 · 5 comments

Comments

@janpauldahlke
Copy link

janpauldahlke commented Jun 7, 2023

io.fabric8 docker-maven-plugin build error

 mvn -version
Apache Maven 3.9.2 (c9616018c7a021c1c39be70fb2843d6f5f9b8a1c)
Maven home: /opt/homebrew/Cellar/maven/3.9.2/libexec
Java version: 17.0.7, vendor: Eclipse Adoptium, runtime: /Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home
Default locale: en_DE, platform encoding: UTF-8
OS name: "mac os x", version: "13.0", arch: "aarch64", family: "mac"

Prerequisites:

  • I am working with a new apple M2, which is arm64
  • java is installed
  • docker is installed
  • mvn is installed via brew and has sufficient permissions

While running mvn clean install to install our project there occurs an error for a subproject, which is in /distribution/docker.
The pom.xml section for the plugin looks like this:

<plugin>  
<groupId>io.fabric8</groupId>  
<artifactId>docker-maven-plugin</artifactId>  
<version>0.42.1</version>  
<extensions>true</extensions>  
<configuration>  
<images>  
<image>  
<alias>hcp-app</alias>  
<name>${docker.repository}/<myCompanyDomainFolders>${docker.image.name}  
</name>  
<build>  
<contextDir>${project.build.directory}/classes/app</contextDir>  
<args>  
<JAR_FILE>hcp-server-${project.version}.jar</JAR_FILE>  
</args>  
<tags>  
<tag>${docker.image.tag}</tag>  
</tags>  
<buildx>  
<platforms>  
<platform>linux/amd64</platform>  
<platform>linux/arm64</platform>  
</platforms>  
</buildx>  
</build>  
</image>  
</images>  
</configuration>

Error is:

[ERROR] Failed to execute goal io.fabric8:docker-maven-plugin:0.42.1:build (build-image-app) on project hcp-docker: Error status (125) while creating builder maven -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal io.fabric8:docker-maven-plugin:0.42.1:build (build-image-app) on project hcp-docker: Error status (125) while creating builder maven

I also tried up- (0.43.0) and downgrading of the plugin. No success.
I also understood that <platform>linux/arm64</platform>would be correct for the my hardwares architecture.

Any ideas? For my colleagues that to not work on Mac the build works.
Can anyone provide some help? Thanks in advance for your time reading this.

@janpauldahlke
Copy link
Author

iam also providing the complete trace of mvn install from within the subproject

➜  hcp-docker git:(main) ✗ mvn install
[INFO] Scanning for projects...
[INFO] 
[INFO] ---------------------< de.akquinet.hcp:hcp-docker >---------------------
[INFO] Building HCP-Docker 0.0.1-SNAPSHOT
[INFO]   from pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- resources:3.3.0:resources (default-resources) @ hcp-docker ---
[INFO] Copying 1 resource to /Users/jdahlke/dev/HealthCarePortal/hcp-distribution/hcp-docker/target/classes/app
[INFO] 
[INFO] --- compiler:3.10.1:compile (default-compile) @ hcp-docker ---
[INFO] No sources to compile
[INFO] 
[INFO] --- resources:3.3.0:testResources (default-testResources) @ hcp-docker ---
[INFO] skip non existing resourceDirectory /Users/jdahlke/dev/HealthCarePortal/hcp-distribution/hcp-docker/src/test/resources
[INFO] 
[INFO] --- compiler:3.10.1:testCompile (default-testCompile) @ hcp-docker ---
[INFO] No sources to compile
[INFO] 
[INFO] --- surefire:3.0.0:test (default-test) @ hcp-docker ---
[INFO] No tests to run.
[INFO] 
[INFO] --- dependency:2.8:copy (copy-backend) @ hcp-docker ---
[INFO] Configured Artifact: de.akquinet.hcp:hcp-server:?:jar
[INFO] de.akquinet.hcp:hcp-server:0.0.1-SNAPSHOT:jar already exists in /Users/jdahlke/dev/HealthCarePortal/hcp-distribution/hcp-docker/target/classes/app
[INFO] 
[INFO] --- jar:3.3.0:jar (default-jar) @ hcp-docker ---
[INFO] 
[INFO] --- docker:0.42.1:build (build-image-app) @ hcp-docker ---
[INFO] Building tar: /Users/jdahlke/dev/HealthCarePortal/hcp-distribution/hcp-docker/target/docker/gitlab.spree.de/8443/akquinet/health/zpa/poc/zpa-portal/hcp-docker/tmp/docker-build.tar
[INFO] DOCKER> [gitlab.spree.de:8443/akquinet/health/zpa/poc/zpa-portal/hcp-docker:latest] "hcp-app": Created docker-build.tar in 421 milliseconds
[INFO] DOCKER> docker --config /Users/jdahlke/dev/HealthCarePortal/hcp-distribution/hcp-docker/target/docker/gitlab.spree.de/8443/akquinet/health/zpa/poc/zpa-portal/hcp-docker/docker buildx create --driver docker-container --name maven
[INFO] DOCKER> unknown flag: --driver
[INFO] DOCKER> See 'docker --help'.
[INFO] DOCKER> 
[INFO] DOCKER> Usage:  docker [OPTIONS] COMMAND
[INFO] DOCKER> 
[INFO] DOCKER> A self-sufficient runtime for containers
[INFO] DOCKER> 
[INFO] DOCKER> Common Commands:
[INFO] DOCKER>   run         Create and run a new container from an image
[INFO] DOCKER>   exec        Execute a command in a running container
[INFO] DOCKER>   ps          List containers
[INFO] DOCKER>   build       Build an image from a Dockerfile
[INFO] DOCKER>   pull        Download an image from a registry
[INFO] DOCKER>   push        Upload an image to a registry
[INFO] DOCKER>   images      List images
[INFO] DOCKER>   login       Log in to a registry
[INFO] DOCKER>   logout      Log out from a registry
[INFO] DOCKER>   search      Search Docker Hub for images
[INFO] DOCKER>   version     Show the Docker version information
[INFO] DOCKER>   info        Display system-wide information
[INFO] DOCKER> 
[INFO] DOCKER> Management Commands:
[INFO] DOCKER>   builder     Manage builds
[INFO] DOCKER>   container   Manage containers
[INFO] DOCKER>   context     Manage contexts
[INFO] DOCKER>   image       Manage images
[INFO] DOCKER>   manifest    Manage Docker image manifests and manifest lists
[INFO] DOCKER>   network     Manage networks
[INFO] DOCKER>   plugin      Manage plugins
[INFO] DOCKER>   system      Manage Docker
[INFO] DOCKER>   trust       Manage trust on Docker images
[INFO] DOCKER>   volume      Manage volumes
[INFO] DOCKER> 
[INFO] DOCKER> Swarm Commands:
[INFO] DOCKER>   swarm       Manage Swarm
[INFO] DOCKER> 
[INFO] DOCKER> Commands:
[INFO] DOCKER>   attach      Attach local standard input, output, and error streams to a running container
[INFO] DOCKER>   commit      Create a new image from a container's changes
[INFO] DOCKER>   cp          Copy files/folders between a container and the local filesystem
[INFO] DOCKER>   create      Create a new container
[INFO] DOCKER>   diff        Inspect changes to files or directories on a container's filesystem
[INFO] DOCKER>   events      Get real time events from the server
[INFO] DOCKER>   export      Export a container's filesystem as a tar archive
[INFO] DOCKER>   history     Show the history of an image
[INFO] DOCKER>   import      Import the contents from a tarball to create a filesystem image
[INFO] DOCKER>   inspect     Return low-level information on Docker objects
[INFO] DOCKER>   kill        Kill one or more running containers
[INFO] DOCKER>   load        Load an image from a tar archive or STDIN
[INFO] DOCKER>   logs        Fetch the logs of a container
[INFO] DOCKER>   pause       Pause all processes within one or more containers
[INFO] DOCKER>   port        List port mappings or a specific mapping for the container
[INFO] DOCKER>   rename      Rename a container
[INFO] DOCKER>   restart     Restart one or more containers
[INFO] DOCKER>   rm          Remove one or more containers
[INFO] DOCKER>   rmi         Remove one or more images
[INFO] DOCKER>   save        Save one or more images to a tar archive (streamed to STDOUT by default)
[INFO] DOCKER>   start       Start one or more stopped containers
[INFO] DOCKER>   stats       Display a live stream of container(s) resource usage statistics
[INFO] DOCKER>   stop        Stop one or more running containers
[INFO] DOCKER>   tag         Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE
[INFO] DOCKER>   top         Display the running processes of a container
[INFO] DOCKER>   unpause     Unpause all processes within one or more containers
[INFO] DOCKER>   update      Update configuration of one or more containers
[INFO] DOCKER>   wait        Block until one or more containers stop, then print their exit codes
[INFO] DOCKER> 
[INFO] DOCKER> Global Options:
[INFO] DOCKER>       --config string      Location of client config files (default
[INFO] DOCKER>                            "/Users/jdahlke/.docker")
[INFO] DOCKER>   -c, --context string     Name of the context to use to connect to the
[ERROR] DOCKER> Error status (125) while creating builder maven
[INFO] DOCKER>                            daemon (overrides DOCKER_HOST env var and
[INFO] DOCKER>                            default context set with "docker context use")
[INFO] DOCKER>   -D, --debug              Enable debug mode
[INFO] DOCKER>   -H, --host list          Daemon socket to connect to
[INFO] DOCKER>   -l, --log-level string   Set the logging level ("debug", "info",
[INFO] DOCKER>                            "warn", "error", "fatal") (default "info")
[INFO] DOCKER>       --tls                Use TLS; implied by --tlsverify
[INFO] DOCKER>       --tlscacert string   Trust certs signed only by this CA (default
[INFO] DOCKER>                            "/Users/jdahlke/.docker/ca.pem")
[INFO] DOCKER>       --tlscert string     Path to TLS certificate file (default
[INFO] DOCKER>                            "/Users/jdahlke/.docker/cert.pem")
[INFO] DOCKER>       --tlskey string      Path to TLS key file (default
[INFO] DOCKER>                            "/Users/jdahlke/.docker/key.pem")
[INFO] DOCKER>       --tlsverify          Use TLS and verify the remote
[INFO] DOCKER>   -v, --version            Print version information and quit
[INFO] DOCKER> 
[INFO] DOCKER> Run 'docker COMMAND --help' for more information on a command.
[INFO] DOCKER> 
[INFO] DOCKER> For more help on how to use Docker, head to https://docs.docker.com/go/guides/
[INFO] DOCKER> 
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  2.104 s
[INFO] Finished at: 2023-06-07T12:03:20+02:00
[INFO] ------------------------------------------------------------------------
[WARNING] 
[WARNING] Plugin validation issues were detected in 4 plugin(s)
[WARNING] 
[WARNING]  * io.fabric8:docker-maven-plugin:0.42.1
[WARNING]  * org.apache.maven.plugins:maven-compiler-plugin:3.10.1
[WARNING]  * org.apache.maven.plugins:maven-dependency-plugin:2.8
[WARNING]  * org.apache.maven.plugins:maven-resources-plugin:3.3.0
[WARNING] 
[WARNING] For more or less details, use 'maven.plugin.validation' property with one of the values (case insensitive): [BRIEF, DEFAULT, VERBOSE]
[WARNING] 
[ERROR] Failed to execute goal io.fabric8:docker-maven-plugin:0.42.1:build (build-image-app) on project hcp-docker: Error status (125) while creating builder maven -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
➜  hcp-docker git:(main) ✗ 

@rohanKanojia
Copy link
Member

@janpauldahlke : Perhaps you wanted to create issue on https://github.com/fabric8io/docker-maven-plugin?

Do you have docker buildx plugin installed?

@janpauldahlke
Copy link
Author

Sorry i might have raised it in the wrong project. Will un/re-do. Thanks

@janpauldahlke
Copy link
Author

I gonna close, the error occured from docker buildx which itself recived a wrong flag as seen here DOCKER> docker --config <PathToFile> buildx create --driver docker-container --name maven [INFO] DOCKER> unknown flag: --driver

@janpauldahlke
Copy link
Author

for future readers: i found my solution here: fabric8io/docker-maven-plugin#1678

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants