1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/builder
Yong Tang 6f7e8d1d7f Use filepath.Clean in normaliseWorkdir for windows
As is seem in the comment of `normaliseWorkdir` for windows:
```
...
	//	WORKDIR c:\\foo                 --> C:\foo
	//	WORKDIR \\foo                   --> C:\foo
...
```

However, this is not the case in the current implementation because
`filepath.FromSlash` is used and `FromSlash` does not replace multiple
separator with a single one (`file.Clean` does).
So `normaliseWorkdir` does not truly normalize workdir.

This fix changes the implementation of `normaliseWorkdir` and use
`filepath.Clean` instead of `filepath.FromSlash`.

Additional test cases have been added to the unit test.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-10-31 13:27:05 -07:00
..
dockerfile Use filepath.Clean in normaliseWorkdir for windows 2016-10-31 13:27:05 -07:00
dockerignore add defer file.Close to avoid potential fd leak 2016-08-10 08:36:09 +08:00
builder.go Generate container create response from swagger spec. 2016-10-31 11:16:02 -04:00
context.go Fix directory walker error checking 2016-05-26 14:59:38 -07:00
context_test.go Builder unit tests refactoring 2016-05-03 19:00:35 +02:00
context_unix.go Move validateContextDirectory to builder package. 2016-02-09 22:19:09 +01:00
context_windows.go Move validateContextDirectory to builder package. 2016-02-09 22:19:09 +01:00
dockerignore.go add defer file.Close to avoid potential fd leak 2016-08-10 08:36:09 +08:00
dockerignore_test.go Builder unit tests refactoring 2016-05-03 19:00:35 +02:00
git.go utils: move git functions to pkg/gitutils 2015-12-14 14:59:52 +01:00
remote.go pkg/archive: remove unnecessary Archive and Reader type 2016-10-20 19:31:24 -07:00
remote_test.go pkg/archive: remove unnecessary Archive and Reader type 2016-10-20 19:31:24 -07:00
tarsum.go Windows: Fix builder cache bug 2016-10-27 12:27:30 -07:00
tarsum_test.go Builder unit tests refactoring 2016-05-03 19:00:35 +02:00
utils_test.go Builder unit tests refactoring 2016-05-03 19:00:35 +02:00