I have created a multimodule, sbt
project in Scala. For now it is:
main project (
main-service
) withbuild.sbt
filehttp module with
Main
class
In my sbt
file I have:
lazy val root = (project in file("."))
.aggregate(http)
.settings(
dockerBaseImage := "openjdk:jre-alpine",
name := "main-service",
libraryDependencies ++= Seq(
)
)
.enablePlugins(JavaAppPackaging)
.enablePlugins(DockerPlugin)
.enablePlugins(AshScriptPlugin)
lazy val http = (project in file("http"))
.settings(
mainClass in Compile := Some("Main"),
name := "main-http",
libraryDependencies ++= Seq(
))
As you can see, I want to run it with docker
. Image of this project is created well, but when I made docker run
then I got an error:
docker: Error response from daemon: OCI runtime create failed: container_linux.go:345: starting container process caused "exec: \"/opt/docker/bin/main-service\": stat /opt/docker/bin/main-service: no such file or directory": unknown.
I think the problem could be with mainClass
line. I have my Main
class in main-http/src/main/scala
directory, but it looks like docker does not see it.
How should I move this Main
class or change path to it and run it correctly?