FROM maven:3.8.4-openjdk-17-slim as maven
# 指定构建过程中的工作目录
WORKDIR /app
# 将src目录下所有文件,拷贝到工作目录中src目录下
COPY src /app/src
# 将pom.xml文件,拷贝到工作目录下
COPY pom.xml /app
# 执行代码编译命令
RUN mvn -f /app/pom.xml clean package
[2021-12-22 16:58:01] Step 8/14 : RUN mvn -f /app/pom.xml clean package
[2021-12-22 16:58:01] ---> Running in 977f1c20df2e
[2021-12-22 16:58:01] ls: cannot access '/usr/bin/mvn': Operation not permitted
[2021-12-22 16:58:01] Error: Could not find or load main class org.codehaus.plexus.classworlds.launcher.Launcher
[2021-12-22 16:58:01] Caused by: java.lang.ClassNotFoundException: org.codehaus.plexus.classworlds.launcher.Launcher
[2021-12-22 16:58:02] The command '/bin/sh -c mvn -f /app/pom.xml clean package' returned a non-zero code: 1
script returned exit code 1
你好,这边排查了哈,代码有问题,建议自己在本地先mvn clean package一下
你好,麻烦提供下环境ID。