diff --git a/build.sbt b/build.sbt index 820ac537..27c9ca44 100644 --- a/build.sbt +++ b/build.sbt @@ -105,6 +105,10 @@ lazy val root = (project in file(".")) Docker / version := (ThisBuild / version).value.replaceAll("-SNAPSHOT", "-latest").toLowerCase, Docker / packageName := s"${name.value}", Docker / dockerExposedPorts := Seq(8080), + Docker / dockerAliases := Seq( + dockerAlias.value, + Option(System.getenv("COMMIT_SHA")).fold(dockerAlias.value)(t => dockerAlias.value.withTag(Some(t))) + ).distinct, libraryDependencies := Dependencies.Jars.`server`, Docker / maintainer := "https://pagopa.it", dockerCommands += Cmd("LABEL", s"org.opencontainers.image.source https://github.com/pagopa/${name.value}")