https://rancher.com/ logo
Title
a

abundant-fall-57530

08/11/2022, 10:53 PM
I'm not 100% sure this is a Rancher Desktop issue, but will start here as I hit a dead-end in my own investigation: /usr/share/maven/bin/mvn: package: No such file or directory when building on macOS đŸ§”
The error I'm seeing is:
Step 5/11 : RUN ["mvn", "package", "dependency:copy-dependencies", "-DincludeScope=runtime", "-DskipTests=true", "-Dmdep.prependGroupId=true", "-DoutputDirectory=target", "--fail-never"]
 ---> [Warning] The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
 ---> Running in 822010bdb134
/usr/share/maven/bin/mvn: package: No such file or directory
The command 'mvn package dependency:copy-dependencies -DincludeScope=runtime -DskipTests=true -Dmdep.prependGroupId=true -DoutputDirectory=target --fail-never' returned a non-zero code: 127
% which mvn; mvn -version
/opt/local/bin/mvn
Apache Maven 3.8.6 (84538c9988a25aec085021c365c560670ad80f63)
Maven home: /opt/local/share/java/maven3
Java version: 11.0.16, vendor: OpenJDK Porters Group, runtime: /Library/Java/JavaVirtualMachines/openjdk11/Contents/Home
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "12.5", arch: "aarch64", family: "mac"
%
I have no
/usr/share/maven
hierarchy, and I don't think I should.
If I build manually with:
% mvn package dependency:copy-dependencies -DincludeScope=runtime -DskipTests=true -Dmdep.prependGroupId=true -DoutputDirectory=target --fail-never
it works fine and builds to completion.
But when I build using the OCI Fn CLI, which invokes docker to do the build, I get the error about /usr/share/maven/bin/mvn
The docker version is:
% which docker; docker -v
/Users/bp/.rd/bin/docker
Docker version 20.10.17-rd, build c2e4e01
%
This is macOS Monterey 12.5 on Apple silicon.
I've searched through the source code for OCI Fn CLI and there is no call out to "/usr/share/maven" anywhere, so I'm not sure if it's coming from docker or some other environment variable set somewhere in the build chain.
Would appreciate any advice on how to debug this.
b

better-fountain-25714

08/12/2022, 11:31 AM
Is there a difference when you run this in dockerfile?
RUN which mvn; nvn -version
had an issue with nvm, not mvn, which needed a tty to setup user info first.
p

proud-jewelry-46860

08/15/2022, 6:21 PM
Hi! Is this Rancher Desktop 1.5.0? Because 1.5.1 has a fix related to running x86_64 things on aarch64 (and vice versa) that may impact this.
a

abundant-fall-57530

08/15/2022, 6:35 PM
Yeah, the updated version fixed it!