Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move some defaults of docker to global scope #1403

Merged
merged 1 commit into from
Mar 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,7 @@ object DockerPlugin extends AutoPlugin {
// Instead of making dockerPermissionStrategy dependent on the Docker version, what we do instead is to
// run validation, and warn the build users if the strategy is not compatible with `docker` that's in scope.
dockerPermissionStrategy := DockerPermissionStrategy.MultiStage,
dockerChmodType := DockerChmodType.UserGroupReadExecute
)

override lazy val projectSettings: Seq[Setting[_]] = Seq(
dockerChmodType := DockerChmodType.UserGroupReadExecute,
dockerBaseImage := "openjdk:8",
dockerExposedPorts := Seq(),
dockerExposedUdpPorts := Seq(),
Expand All @@ -90,14 +87,18 @@ object DockerPlugin extends AutoPlugin {
dockerEnvVars := Map(),
dockerRepository := None,
dockerUsername := None,
dockerUpdateLatest := false,
dockerAutoremoveMultiStageIntermediateImages := true,
dockerCmd := Seq()
)

override lazy val projectSettings: Seq[Setting[_]] = Seq(
dockerAlias := DockerAlias(
(dockerRepository in Docker).value,
(dockerUsername in Docker).value,
(packageName in Docker).value,
Option((version in Docker).value)
),
dockerUpdateLatest := false,
dockerAutoremoveMultiStageIntermediateImages := true,
dockerLayerGrouping := { _: String =>
None
},
Expand Down Expand Up @@ -126,7 +127,6 @@ object DockerPlugin extends AutoPlugin {
Seq(alias)
},
dockerEntrypoint := Seq(s"${(defaultLinuxInstallLocation in Docker).value}/bin/${executableScriptName.value}"),
dockerCmd := Seq(),
dockerVersion := Try(
Process(dockerExecCommand.value ++ Seq("version", "--format", "'{{.Server.Version}}'")).!!
).toOption
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,14 @@ object UniversalPlugin extends AutoPlugin {
override def projectConfigurations: Seq[Configuration] =
Seq(Universal, UniversalDocs, UniversalSrc)

override lazy val buildSettings: Seq[Setting[_]] = Seq[Setting[_]](
// Since more than just the docker plugin uses the docker command, we define this in the universal plugin
// so that it can be configured once and shared by all plugins without requiring the docker plugin. Also, make it
// a build settings so that it can be overridden once, at the build level.
DockerPlugin.autoImport.dockerExecCommand := Seq("docker"),
containerBuildImage := None
)
override def globalSettings: Seq[Def.Setting[_]] =
Seq[Setting[_]](
// Since more than just the docker plugin uses the docker command, we define this in the universal plugin
// so that it can be configured once and shared by all plugins without requiring the docker plugin.
DockerPlugin.autoImport.dockerExecCommand := Seq("docker")
)

override lazy val buildSettings: Seq[Setting[_]] = Seq[Setting[_]](containerBuildImage := None)

/** The basic settings for the various packaging types. */
override lazy val projectSettings: Seq[Setting[_]] = Seq[Setting[_]](
Expand Down