I’m trying to create docker Image of my scala project using sbt-native-packager
.
The project also include Gatlings load test
.
Gatlings
load tests are working fine, but when I try to create it’s docker image it throw an exception java.lang.IllegalArgumentException
.
here is the detail:
sbt version is 1.9.6 and scala version is 2.13.4.
build.sbt:
ThisBuild / version := "0.1.0-SNAPSHOT"
ThisBuild / scalaVersion := "2.13.4"
ThisBuild / scapegoatVersion := "1.4.8"
lazy val root = (project in file("."))
.settings(
name := "face-recognition"
)
enablePlugins(GatlingPlugin, JavaAppPackaging, DockerPlugin, ScoverageSbtPlugin)
ocker / packageName := "face-recognition"
Docker / version := "0.0.1"
dockerExposedPorts := Seq(8080)
dockerChmodType := DockerChmodType.UserGroupWriteExecute
dockerPermissionStrategy := DockerPermissionStrategy.CopyChown
dockerAdditionalPermissions += (DockerChmodType.UserGroupPlusExecute, "/var/run/")
Docker / daemonUserUid := None
Docker / daemonUser := "root"
dockerBaseImage := "amazoncorretto:11-alpine3.18-jdk"
addCommandAlias("dockerImage", ";clean; reload; coverageOff; compile; docker:publishLocal")
libraryDependencies ++= Seq(
"io.gatling.highcharts" % "gatling-charts-highcharts" % "3.9.1" % "test",
"io.gatling" % "gatling-test-framework" % "3.9.1" % "test",
"com.typesafe.akka" %% "akka-slf4j" % "2.8.0",
"io.gatling" % "gatling-http" % "3.5.1"
)
plugin.sbt:
addSbtPlugin("io.gatling" % "gatling-sbt" % "4.2.6")
When I run command dockerImage
get an error:
[error] stack trace is suppressed; run last Gatling-it / enterprisePackage for the full output
[error] (Gatling-it / enterprisePackage) java.lang.IllegalArgumentException: Couldn't locate Gatling libraries in the classpath