使用sbt-native-packager获得sbt项目的docker支持时出错

时间:2019-05-30 10:06:37

标签: scala docker plugins sbt sbt-native-packager

我在我的plugins.sbt文件中添加了sbt-native-packager版本1.3.15。 在build.sbt文件中,我正在使用enablePlugins(DockerPligin)。 在sbt shell上运行以下命令时,我遇到以下错误:

sbt>docker:publishLocal

错误->

    [error] java.io.IOException: Cannot run program "docker" (in directory "C:\Users\A674634\Desktop\Scala\playProjects\akka-cluster-playground\target\docker\stage"): CreateProcess error=2, The system cannot find the file specified
    [error]         at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
    [error]         at scala.sys.process.ProcessBuilderImpl$Simple.run(ProcessBuilderImpl.scala:71)
    [error]         at scala.sys.process.ProcessBuilderImpl$AbstractBuilder.run(ProcessBuilderImpl.scala:102)
    [error]         at scala.sys.process.ProcessBuilderImpl$AbstractBuilder.$anonfun$runBuffered$1(ProcessBuilderImpl.scala:150)
    [error]         at scala.runtime.java8.JFunction0$mcI$sp.apply(JFunction0$mcI$sp.java:12)
    [error]         at com.typesafe.sbt.packager.docker.DockerPlugin$$anon$1.buffer(DockerPlugin.scala:348)
    [error]         at scala.sys.process.ProcessBuilderImpl$AbstractBuilder.runBuffered(ProcessBuilderImpl.scala:150)
    [error]         at scala.sys.process.ProcessBuilderImpl$AbstractBuilder.$bang(ProcessBuilderImpl.scala:116)
    [error]         at com.typesafe.sbt.packager.docker.DockerPlugin$.publishLocalDocker(DockerPlugin.scala:355)
    [error]         at com.typesafe.sbt.packager.docker.DockerPlugin$.$anonfun$projectSettings$30(DockerPlugin.scala:127)
    [error]         at com.typesafe.sbt.packager.docker.DockerPlugin$.$anonfun$projectSettings$30$adapted(DockerPlugin.scala:125)
    [error]         at scala.Function1.$anonfun$compose$1(Function1.scala:44)
    [error]         at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:40)
    [error]         at sbt.std.Transform$$anon$4.work(System.scala:67)
    [error]         at sbt.Execute.$anonfun$submit$2(Execute.scala:269)
    [error]         at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:16)
    [error]         at sbt.Execute.work(Execute.scala:278)
    [error]         at sbt.Execute.$anonfun$submit$1(Execute.scala:269)
    [error]         at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:178)
    [error]         at sbt.CompletionService$$anon$2.call(CompletionService.scala:37)
    [error]         at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    [error]         at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    [error]         at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    [error]         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    [error]         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    [error]         at java.lang.Thread.run(Thread.java:748)
    [error] Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
    [error]         at java.lang.ProcessImpl.create(Native Method)
    [error]         at java.lang.ProcessImpl.<init>(ProcessImpl.java:386)
    [error]         at java.lang.ProcessImpl.start(ProcessImpl.java:137)
    [error]         at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
    [error]         at scala.sys.process.ProcessBuilderImpl$Simple.run(ProcessBuilderImpl.scala:71)
    [error]         at scala.sys.process.ProcessBuilderImpl$AbstractBuilder.run(ProcessBuilderImpl.scala:102)
    [error]         at scala.sys.process.ProcessBuilderImpl$AbstractBuilder.$anonfun$runBuffered$1(ProcessBuilderImpl.scala:150)
    [error]         at scala.runtime.java8.JFunction0$mcI$sp.apply(JFunction0$mcI$sp.java:12)
    [error]         at com.typesafe.sbt.packager.docker.DockerPlugin$$anon$1.buffer(DockerPlugin.scala:348)
    [error]         at scala.sys.process.ProcessBuilderImpl$AbstractBuilder.runBuffered(ProcessBuilderImpl.scala:150)
    [error]         at scala.sys.process.ProcessBuilderImpl$AbstractBuilder.$bang(ProcessBuilderImpl.scala:116)
    [error]         at com.typesafe.sbt.packager.docker.DockerPlugin$.publishLocalDocker(DockerPlugin.scala:355)
    [error]         at com.typesafe.sbt.packager.docker.DockerPlugin$.$anonfun$projectSettings$30(DockerPlugin.scala:127)
    [error]         at com.typesafe.sbt.packager.docker.DockerPlugin$.$anonfun$projectSettings$30$adapted(DockerPlugin.scala:125)
    [error]         at scala.Function1.$anonfun$compose$1(Function1.scala:44)
    [error]         at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:40)
    [error]         at sbt.std.Transform$$anon$4.work(System.scala:67)
    [error]         at sbt.Execute.$anonfun$submit$2(Execute.scala:269)
    [error]         at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:16)
    [error]         at sbt.Execute.work(Execute.scala:278)
    [error]         at sbt.Execute.$anonfun$submit$1(Execute.scala:269)
    [error]         at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:178)
    [error]         at sbt.CompletionService$$anon$2.call(CompletionService.scala:37)
    [error]         at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    [error]         at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    [error]         at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    [error]         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    [error]         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    [error]         at java.lang.Thread.run(Thread.java:748)
    [IJ]sbt:akka-cluster-playground> [error] (Docker / publishLocal) java.io.IOException: Cannot run program "docker" (in directory "C:\Users\A674634\Desktop\Scala\playProjects\akka-cluster-playground\target\docker\stage"): CreateProcess error=2, The system cannot find the file specified

1 个答案:

答案 0 :(得分:1)

我相信您应该在项目根文件夹中执行该命令。您现在在哪个文件夹中?