Skip to content

Commit ead5db4

Browse files
authored
FIX #1205 undefined setting makeBashScripts with vanilla DockerPlugin (#1207)
* FIX #1205 Error "Reference to undefined setting: makeBashScripts from dockerAdditi... * Scalafmt * Use linuxDefaultInstallationPath and remove bat files * Scalafmt
1 parent 8e9c837 commit ead5db4

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

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

+9-8
Original file line numberDiff line numberDiff line change
@@ -109,14 +109,15 @@ object DockerPlugin extends AutoPlugin {
109109
dockerRmiCommand := dockerExecCommand.value ++ Seq("rmi"),
110110
dockerBuildCommand := dockerExecCommand.value ++ Seq("build") ++ dockerBuildOptions.value ++ Seq("."),
111111
dockerAdditionalPermissions := {
112-
val scripts = makeBashScripts.value
113-
val ms = (mappings in Docker).value
114-
scripts flatMap {
115-
case (script, _) =>
116-
ms collect {
117-
case (k, v) if k == script => DockerChmodType.UserGroupPlusExecute -> v
118-
}
119-
}
112+
val basePath = (defaultLinuxInstallLocation in Docker).value
113+
(mappings in Docker).value
114+
.collect {
115+
// by default we assume everything in the bin/ folder should be executable that is not a .bat file
116+
case (_, path) if path.startsWith(s"$basePath/bin/") && !path.endsWith(".bat") =>
117+
DockerChmodType.UserGroupPlusExecute -> path
118+
// sh files should also be marked as executable
119+
case (_, path) if path.endsWith(".sh") => DockerChmodType.UserGroupPlusExecute -> path
120+
}
120121
},
121122
dockerCommands := {
122123
val strategy = dockerPermissionStrategy.value

0 commit comments

Comments
 (0)