Skip to content

Commit e75f1d6

Browse files
committed
Merge pull request #293 from rfranco/fix-docker-commands
fix order of docker commands
2 parents 209ab38 + 2c07381 commit e75f1d6

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

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

+6-3
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,12 @@ trait DockerPlugin extends Plugin with UniversalPlugin {
99
val Docker = config("docker") extend Universal
1010

1111
private[this] final def makeDockerContent(dockerBaseImage: String, dockerBaseDirectory: String, maintainer: String, daemonUser: String, name: String, exposedPorts: Seq[Int], exposedVolumes: Seq[String]) = {
12-
val dockerCommands = Seq(
12+
val headerCommands = Seq(
1313
Cmd("FROM", dockerBaseImage),
14-
Cmd("MAINTAINER", maintainer),
14+
Cmd("MAINTAINER", maintainer)
15+
)
16+
17+
val dockerCommands = Seq(
1518
Cmd("ADD", "files /"),
1619
Cmd("WORKDIR", "%s" format dockerBaseDirectory),
1720
ExecCmd("RUN", "chown", "-R", daemonUser, "."),
@@ -42,7 +45,7 @@ trait DockerPlugin extends Plugin with UniversalPlugin {
4245
)
4346
}
4447

45-
Dockerfile(volumeCommands ++ exposeCommand ++ dockerCommands: _*).makeContent
48+
Dockerfile(headerCommands ++ volumeCommands ++ exposeCommand ++ dockerCommands: _*).makeContent
4649
}
4750

4851
private[this] final def generateDockerConfig(

0 commit comments

Comments
 (0)