Skip to content

Commit 89c3180

Browse files
guizmaiimuuki88
andauthored
Fix #1464 (#1465)
* Fix #1464 * fmt * fmt * fmt Co-authored-by: Nepomuk Seiler <muuki88@users.noreply.github.com>
1 parent 54c3106 commit 89c3180

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

src/main/scala/com/typesafe/sbt/packager/docker/DockerPlugin.scala

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -94,16 +94,16 @@ object DockerPlugin extends AutoPlugin {
9494

9595
override lazy val projectSettings: Seq[Setting[_]] = Seq(
9696
dockerAlias := DockerAlias(
97-
(dockerRepository in Docker).value,
98-
(dockerUsername in Docker).value,
99-
(packageName in Docker).value,
100-
Option((version).value)
97+
(Docker / dockerRepository).value,
98+
(Docker / dockerUsername).value,
99+
(Docker / packageName).value,
100+
Option((Docker / version).value)
101101
),
102102
dockerLayerGrouping := { _: String =>
103103
None
104104
},
105105
dockerGroupLayers := {
106-
val dockerBaseDirectory = (defaultLinuxInstallLocation in Docker).value
106+
val dockerBaseDirectory = (Docker / defaultLinuxInstallLocation).value
107107
// Ensure this doesn't break even if the JvmPlugin isn't enabled.
108108
var artifacts = projectDependencyArtifacts.?.value.getOrElse(Nil).map(_.data).toSet
109109

@@ -140,7 +140,7 @@ object DockerPlugin extends AutoPlugin {
140140
else
141141
Seq(alias)
142142
},
143-
dockerEntrypoint := Seq(s"${(defaultLinuxInstallLocation in Docker).value}/bin/${executableScriptName.value}"),
143+
dockerEntrypoint := Seq(s"${(Docker / defaultLinuxInstallLocation).value}/bin/${executableScriptName.value}"),
144144
dockerVersion := Try(
145145
Process(dockerExecCommand.value ++ Seq("version", "--format", "'{{.Server.Version}}'")).!!
146146
).toOption
@@ -158,8 +158,8 @@ object DockerPlugin extends AutoPlugin {
158158
dockerRmiCommand := dockerExecCommand.value ++ Seq("rmi"),
159159
dockerBuildCommand := dockerExecCommand.value ++ Seq("build") ++ dockerBuildOptions.value ++ Seq("."),
160160
dockerAdditionalPermissions := {
161-
val basePath = (defaultLinuxInstallLocation in Docker).value
162-
(dockerLayerMappings in Docker).value
161+
val basePath = (Docker / defaultLinuxInstallLocation).value
162+
(Docker / dockerLayerMappings).value
163163
.collect {
164164
// by default we assume everything in the bin/ folder should be executable that is not a .bat file
165165
case LayeredMapping(_, _, path) if path.startsWith(s"$basePath/bin/") && !path.endsWith(".bat") =>
@@ -171,17 +171,17 @@ object DockerPlugin extends AutoPlugin {
171171
},
172172
dockerCommands := {
173173
val strategy = dockerPermissionStrategy.value
174-
val dockerBaseDirectory = (defaultLinuxInstallLocation in Docker).value
175-
val user = (daemonUser in Docker).value
176-
val uidOpt = (daemonUserUid in Docker).value
177-
val group = (daemonGroup in Docker).value
178-
val gidOpt = (daemonGroupGid in Docker).value
174+
val dockerBaseDirectory = (Docker / defaultLinuxInstallLocation).value
175+
val user = (Docker / daemonUser).value
176+
val uidOpt = (Docker / daemonUserUid).value
177+
val group = (Docker / daemonGroup).value
178+
val gidOpt = (Docker / daemonGroupGid).value
179179
val base = dockerBaseImage.value
180180
val addPerms = dockerAdditionalPermissions.value
181181
val multiStageId = UUID.randomUUID().toString
182-
val generalCommands = makeFromAs(base, "mainstage") +: makeMaintainer((maintainer in Docker).value).toSeq
182+
val generalCommands = makeFromAs(base, "mainstage") +: makeMaintainer((Docker / maintainer).value).toSeq
183183
val stage0name = "stage0"
184-
val layerMappings = (dockerLayerMappings in Docker).value
184+
val layerMappings = (Docker / dockerLayerMappings).value
185185
val layerIdsAscending = layerMappings.map(_.layerId).distinct.sortWith { (a, b) =>
186186
// Make the None (unspecified) layer the last layer
187187
a.getOrElse(Int.MaxValue) < b.getOrElse(Int.MaxValue)
@@ -198,7 +198,7 @@ object DockerPlugin extends AutoPlugin {
198198
Seq(makeUser("root")) ++ layerIdsAscending.map(
199199
l => makeChmodRecursive(dockerChmodType.value, Seq(pathInLayer(dockerBaseDirectory, l)))
200200
) ++ {
201-
val layerToPath = (dockerGroupLayers in Docker).value
201+
val layerToPath = (Docker / dockerGroupLayers).value
202202
addPerms map {
203203
case (tpe, v) =>
204204
// Try and find the source file for the path from the mappings
@@ -309,10 +309,10 @@ object DockerPlugin extends AutoPlugin {
309309
}
310310
),
311311
stage := (stage dependsOn dockerGenerateConfig).value,
312-
stagingDirectory := (target in Docker).value / "stage",
312+
stagingDirectory := (Docker / target).value / "stage",
313313
dockerLayerMappings := {
314314
val dockerGroups = dockerGroupLayers.value
315-
val dockerFinalFiles = (mappings in Docker).value
315+
val dockerFinalFiles = (Docker / mappings).value
316316
for {
317317
mapping @ (file, path) <- dockerFinalFiles
318318
layerIdx = dockerGroups.lift(mapping)
@@ -329,8 +329,8 @@ object DockerPlugin extends AutoPlugin {
329329
validatePackage := Validation
330330
.runAndThrow(validatePackageValidators.value, streams.value.log),
331331
validatePackageValidators := Seq(
332-
nonEmptyMappings((mappings in Docker).value),
333-
filesExist((mappings in Docker).value),
332+
nonEmptyMappings((Docker / mappings).value),
333+
filesExist((Docker / mappings).value),
334334
validateExposedPorts(dockerExposedPorts.value, dockerExposedUdpPorts.value),
335335
validateDockerVersion(dockerApiVersion.value),
336336
validateDockerPermissionStrategy(dockerPermissionStrategy.value, dockerVersion.value, dockerApiVersion.value)
@@ -583,7 +583,7 @@ object DockerPlugin extends AutoPlugin {
583583

584584
/**
585585
* uses the `mappings in Universal` to generate the
586-
* `mappings in Docker`.
586+
* `Docker / mappings`.
587587
*/
588588
def mapGenericFilesToDocker: Seq[Setting[_]] = {
589589
def renameDests(from: Seq[(File, String)], dest: String) =

0 commit comments

Comments
 (0)