我有一个带有sbt-native-packager 1.0.2插件的SBT项目,如果我在本地运行sbt docker:publish,它可以正常工作。当我使用sbt插件在Jenkins中执行相同的操作时,我收到以下错误:
[info] Step 2 : RUN dnf -y install java-1.8.0-openjdk-headless wget sed ca-certificates openssl
[info] ---> Running in 1b3918fcffa6
[info] exec: "dnf -y install java-1.8.0-openjdk-headless wget sed ca-certificates openssl": executable file not found in $PATH
[info] Removing intermediate container 1b3918fcffa6
[error] [8] System error: exec: "dnf -y install java-1.8.0-openjdk-headless wget sed ca-certificates openssl": executable file not found in $PATH
java.lang.RuntimeException: Nonzero exit value: 1
at com.typesafe.sbt.packager.docker.DockerPlugin$.publishLocalDocker(DockerPlugin.scala:282)
at com.typesafe.sbt.packager.docker.DockerPlugin$$anonfun$projectSettings$14.apply(DockerPlugin.scala:100)
at com.typesafe.sbt.packager.docker.DockerPlugin$$anonfun$projectSettings$14.apply(DockerPlugin.scala:99)
at scala.Function4$$anonfun$tupled$1.apply(Function4.scala:35)
at scala.Function4$$anonfun$tupled$1.apply(Function4.scala:34)
at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:40)
at sbt.std.Transform$$anon$4.work(System.scala:63)
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226)
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226)
at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
at sbt.Execute.work(Execute.scala:235)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:226)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:226)
at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:159)
at sbt.CompletionService$$anon$2.call(CompletionService.scala:28)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
[error] (main/docker:publishLocal) Nonzero exit value: 1
我打赌问题是在$ PATH变量的Jenkins配置中,但我不知道如何解决它。我已经尝试/ usr / bin / dnf或两者都使用yum但没有效果。对于/ usr / bin / dnf,它说无法找到路径/ usr / bin / dnf。
有什么想法吗?提前致谢