Commit b4d7cd1 1 parent 54fb9aa commit b4d7cd1 Copy full SHA for b4d7cd1
File tree 1 file changed +9
-4
lines changed
src/main/scala/com/typesafe/sbt/packager/docker
1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -60,10 +60,10 @@ object DockerPlugin extends AutoPlugin {
60
60
import autoImport ._
61
61
62
62
/**
63
- * The separator for makeAdd force UNIX separator.
64
- * The separator doesn't depend to OS where i build Dockerfile .
63
+ * The separator used by makeAdd should be always forced to UNIX separator.
64
+ * The separator doesn't depend on the OS where Dockerfile is being built .
65
65
*/
66
- val SeparatorChar = File .separatorChar
66
+ val UnixSeparatorChar = '/'
67
67
68
68
override def requires = universal.UniversalPlugin
69
69
@@ -159,7 +159,12 @@ object DockerPlugin extends AutoPlugin {
159
159
* @return ADD command adding all files inside the installation directory
160
160
*/
161
161
private final def makeAdd (dockerBaseDirectory : String ): CmdLike = {
162
- val files = dockerBaseDirectory.split(SeparatorChar )(1 )
162
+ /**
163
+ * This is the file path of the file in the Docker image, and does not depend on the OS where the image
164
+ * is being built. This means that it needs to be the Unix file separator even when the image is built
165
+ * on e.g. Windows systems.
166
+ */
167
+ val files = dockerBaseDirectory.split(UnixSeparatorChar )(1 )
163
168
Cmd (" ADD" , s " $files / $files" )
164
169
}
165
170
You can’t perform that action at this time.
0 commit comments