You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
sbt docker:publishLocal should work with DockerPlugin
Actual behaviour
sbt docker:publishLocal only works with JavaAppPackaging
Information
I've started a new project on sbt 1.0.1 (used sbt new sbt/scala-seed.g8 for setup) and added sbt-native-packager 1.2.2 as a plugin. Then i tried to create a docker image out of it using the DockerPlugin like described here.
build.sbt looks like this
lazyvalcommonSettings=List(
organization :="de.test",
scalaVersion :="2.12.3",
version :="0.1.0-SNAPSHOT"
)
lazyvalnotifier= (project in file("modules/notifier")).settings(
commonSettings,
name :="abandonedcartnotifier",
libraryDependencies ++=Seq(
scalaTest %Test,
akkaHttp,
circe
),
cancelable :=true,
fork in run :=true
)
.settings(dockerSettings(9000):_*)
.enablePlugins(DockerPlugin)
lazyvalmigrations= (project in file("modules/migrations"))
.settings(
commonSettings,
name :="migrations",
libraryDependencies ++=Seq(
flyway,
postgresJdbc
)
)
defdockerSettings(port: Int) = {
Seq(
dockerBaseImage :=s"${sys.props.getOrElse("baseimagetag", default ="")}",
dockerRepository :=None,
version in Docker:="current-build",
dockerExposedPorts :=Seq(port),
dockerCommands ++=Seq(Cmd("USER", "daemon"))
)
}
Trying to publish it with sbt -Dbaseimagetag="test/base:20170802-111029-9-b694b9" docker:publishLocal the build however fails everytime because of a missing opt folder
2:00:44 [info] Removing intermediate container 2c942763c2d9
22:00:44 [info] Step 4 : ADD opt /opt
22:00:44 [error] lstat opt: no such file or directory
22:00:44 [error] java.lang.RuntimeException: Nonzero exit value: 1
22:00:44 [error] at com.typesafe.sbt.packager.docker.DockerPlugin$.publishLocalDocker(DockerPlugin.scala:321)
22:00:44 [error] at com.typesafe.sbt.packager.docker.DockerPlugin$.$anonfun$projectSettings$24(DockerPlugin.scala:117)
22:00:44 [error] at com.typesafe.sbt.packager.docker.DockerPlugin$.$anonfun$projectSettings$24$adapted(DockerPlugin.scala:115)
22:00:44 [error] at scala.Function1.$anonfun$compose$1(Function1.scala:44)
22:00:44 [error] at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:42)
22:00:44 [error] at sbt.std.Transform$$anon$4.work(System.scala:64)
22:00:44 [error] at sbt.Execute.$anonfun$submit$2(Execute.scala:257)
22:00:44 [error] at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:16)
22:00:44 [error] at sbt.Execute.work(Execute.scala:266)
22:00:44 [error] at sbt.Execute.$anonfun$submit$1(Execute.scala:257)
22:00:44 [error] at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:167)
22:00:44 [error] at sbt.CompletionService$$anon$2.call(CompletionService.scala:32)
22:00:44 [error] at java.util.concurrent.FutureTask.run(FutureTask.java:266)
22:00:44 [error] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
22:00:44 [error] at java.util.concurrent.FutureTask.run(FutureTask.java:266)
22:00:44 [error] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
22:00:44 [error] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
22:00:44 [error] at java.lang.Thread.run(Thread.java:748)
22:00:44 [error] (notifier/docker:publishLocal) Nonzero exit value: 1
Changing .enablePlugins(DockerPlugin) in build.sbt to .enablePlugins(JavaAppPackaging) creates the docker image successfully.
Am i doing something wrong?
The text was updated successfully, but these errors were encountered:
Expected behaviour
sbt docker:publishLocal
should work withDockerPlugin
Actual behaviour
sbt docker:publishLocal
only works withJavaAppPackaging
Information
I've started a new project on sbt 1.0.1 (used
sbt new sbt/scala-seed.g8
for setup) and added sbt-native-packager 1.2.2 as a plugin. Then i tried to create a docker image out of it using the DockerPlugin like described here.build.sbt looks like this
Trying to publish it with
sbt -Dbaseimagetag="test/base:20170802-111029-9-b694b9" docker:publishLocal
the build however fails everytime because of a missingopt
folderChanging
.enablePlugins(DockerPlugin)
inbuild.sbt
to.enablePlugins(JavaAppPackaging)
creates the docker image successfully.Am i doing something wrong?
The text was updated successfully, but these errors were encountered: