I have an SBT project with sbt-native-packager 1.0.2 plugin that works fine if I run locally sbt docker:publish. When I do the same thing in Jenkins using the sbt plugin, I get the following error:
[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
I bet the problem is in Jenkins configuration of the $PATH variable but I have no idea how to work around it. I already tried /usr/bin/dnf or both with yum but none works. For /usr/bin/dnf it says it cannot find path /usr/bin/dnf.
Any ideas? Thanks in advance