Browse code

Windows: Revert 27884

Signed-off-by: John Howard <jhoward@microsoft.com>
(cherry picked from commit 7e03ce3f13baa61ce5547574163059b712b37025)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>

John Howard authored on 2016/11/17 06:38:45
Showing 2 changed files
... ...
@@ -16,14 +16,6 @@ func (daemon *Daemon) createContainerPlatformSpecificSettings(container *contain
16 16
 		hostConfig.Isolation = daemon.defaultIsolation
17 17
 	}
18 18
 
19
-	if err := daemon.Mount(container); err != nil {
20
-		return nil
21
-	}
22
-	defer daemon.Unmount(container)
23
-	if err := container.SetupWorkingDirectory(0, 0); err != nil {
24
-		return err
25
-	}
26
-
27 19
 	for spec := range config.Volumes {
28 20
 
29 21
 		mp, err := volume.ParseMountRaw(spec, hostConfig.VolumeDriver)
... ...
@@ -1865,6 +1865,10 @@ func (s *DockerSuite) TestBuildWindowsWorkdirProcessing(c *check.C) {
1865 1865
 func (s *DockerSuite) TestBuildWindowsAddCopyPathProcessing(c *check.C) {
1866 1866
 	testRequires(c, DaemonIsWindows)
1867 1867
 	name := "testbuildwindowsaddcopypathprocessing"
1868
+	// TODO Windows (@jhowardmsft). Needs a follow-up PR to 22181 to
1869
+	// support backslash such as .\\ being equivalent to ./ and c:\\ being
1870
+	// equivalent to c:/. This is not currently (nor ever has been) supported
1871
+	// by docker on the Windows platform.
1868 1872
 	dockerfile := `
1869 1873
 		FROM busybox
1870 1874
 			# No trailing slash on COPY/ADD
... ...
@@ -1874,8 +1878,8 @@ func (s *DockerSuite) TestBuildWindowsAddCopyPathProcessing(c *check.C) {
1874 1874
 			WORKDIR /wc2
1875 1875
 			ADD wc2 c:/wc2
1876 1876
 			WORKDIR c:/
1877
-			RUN sh -c "[ $(cat c:/wc1/wc1) = 'hellowc1' ]"
1878
-			RUN sh -c "[ $(cat c:/wc2/wc2) = 'worldwc2' ]"
1877
+			RUN sh -c "[ $(cat c:/wc1) = 'hellowc1' ]"
1878
+			RUN sh -c "[ $(cat c:/wc2) = 'worldwc2' ]"
1879 1879
 
1880 1880
 			# Trailing slash on COPY/ADD, Windows-style path.
1881 1881
 			WORKDIR /wd1
... ...
@@ -7172,31 +7176,6 @@ RUN echo vegeta
7172 7172
 	c.Assert(out, checker.Contains, "Step 3/3 : RUN echo vegeta")
7173 7173
 }
7174 7174
 
7175
-// Verifies if COPY file . when WORKDIR is set to a non-existing directory,
7176
-// the directory is created and the file is copied into the directory,
7177
-// as opposed to the file being copied as a file with the name of the
7178
-// directory. Fix for 27545 (found on Windows, but regression good for Linux too)
7179
-func (s *DockerSuite) TestBuildCopyFileDotWithWorkdir(c *check.C) {
7180
-	name := "testbuildcopyfiledotwithworkdir"
7181
-
7182
-	ctx, err := fakeContext(`FROM busybox
7183
-WORKDIR /foo
7184
-COPY file .
7185
-RUN ["cat", "/foo/file"]
7186
-`,
7187
-		map[string]string{})
7188
-	if err != nil {
7189
-		c.Fatal(err)
7190
-	}
7191
-	defer ctx.Close()
7192
-	if err := ctx.Add("file", "content"); err != nil {
7193
-		c.Fatal(err)
7194
-	}
7195
-	if _, err = buildImageFromContext(name, ctx, true); err != nil {
7196
-		c.Fatal(err)
7197
-	}
7198
-}
7199
-
7200 7175
 func (s *DockerSuite) TestBuildSquashParent(c *check.C) {
7201 7176
 	testRequires(c, ExperimentalDaemon)
7202 7177
 	dockerFile := `