[2022-12-11 13:52:16] Digest: sha256:805f366910aea2a91ed263654d23df58bd239f218b2f9562ff51305be81fa215
[2022-12-11 13:52:16] Status: Downloaded newer image for maven:3.8.6-jdk-11
[2022-12-11 13:52:16] ---> 6c3ab1faec76
[2022-12-11 13:52:16] Step 2/13 : WORKDIR /app
[2022-12-11 13:52:16] ---> Running in d99affdd8ca4
[2022-12-11 13:52:17] Removing intermediate container d99affdd8ca4
[2022-12-11 13:52:17] ---> 52f1f0f036d1
[2022-12-11 13:52:17] Step 3/13 : COPY src /app/src
[2022-12-11 13:52:17] ---> 6c0e849db2b4
[2022-12-11 13:52:17] Step 4/13 : COPY settings.xml pom.xml /app/
[2022-12-11 13:52:17] ---> 405224228c23
[2022-12-11 13:52:17] Step 5/13 : RUN mvn -s /app/settings.xml -f /app/pom.xml clean package
[2022-12-11 13:52:17] ---> Running in e75ea5b12d75
[2022-12-11 13:52:18] ls: cannot access '/usr/bin/mvn': Operation not permitted
[2022-12-11 13:52:18] Error: Could not find or load main class org.codehaus.plexus.classworlds.launcher.Launcher
[2022-12-11 13:52:18] Caused by: java.lang.ClassNotFoundException: org.codehaus.plexus.classworlds.launcher.Launcher
[2022-12-11 13:52:18] The command '/bin/sh -c mvn -s /app/settings.xml -f /app/pom.xml clean package' returned a non-zero code: 1
script returned exit code 1
我本地11的环境,执行mvn方法是ok的
试试这个镜像
maven:3.8.1-jdk-11-slim
我看github上是升级docker解决,或者用这个镜像。我用这个镜像部署成功了