Bladeren bron

Merge pull request #28505 from Microsoft/jjh/revert27884

Windows: Revert 27884
Victor Vieux 8 jaren geleden
bovenliggende
commit
956ff8f773
2 gewijzigde bestanden met toevoegingen van 6 en 35 verwijderingen
  1. 0 8
      daemon/create_windows.go
  2. 6 27
      integration-cli/docker_cli_build_test.go

+ 0 - 8
daemon/create_windows.go

@@ -16,14 +16,6 @@ func (daemon *Daemon) createContainerPlatformSpecificSettings(container *contain
 		hostConfig.Isolation = daemon.defaultIsolation
 		hostConfig.Isolation = daemon.defaultIsolation
 	}
 	}
 
 
-	if err := daemon.Mount(container); err != nil {
-		return nil
-	}
-	defer daemon.Unmount(container)
-	if err := container.SetupWorkingDirectory(0, 0); err != nil {
-		return err
-	}
-
 	for spec := range config.Volumes {
 	for spec := range config.Volumes {
 
 
 		mp, err := volume.ParseMountRaw(spec, hostConfig.VolumeDriver)
 		mp, err := volume.ParseMountRaw(spec, hostConfig.VolumeDriver)

+ 6 - 27
integration-cli/docker_cli_build_test.go

@@ -1865,6 +1865,10 @@ func (s *DockerSuite) TestBuildWindowsWorkdirProcessing(c *check.C) {
 func (s *DockerSuite) TestBuildWindowsAddCopyPathProcessing(c *check.C) {
 func (s *DockerSuite) TestBuildWindowsAddCopyPathProcessing(c *check.C) {
 	testRequires(c, DaemonIsWindows)
 	testRequires(c, DaemonIsWindows)
 	name := "testbuildwindowsaddcopypathprocessing"
 	name := "testbuildwindowsaddcopypathprocessing"
+	// TODO Windows (@jhowardmsft). Needs a follow-up PR to 22181 to
+	// support backslash such as .\\ being equivalent to ./ and c:\\ being
+	// equivalent to c:/. This is not currently (nor ever has been) supported
+	// by docker on the Windows platform.
 	dockerfile := `
 	dockerfile := `
 		FROM busybox
 		FROM busybox
 			# No trailing slash on COPY/ADD
 			# No trailing slash on COPY/ADD
@@ -1874,8 +1878,8 @@ func (s *DockerSuite) TestBuildWindowsAddCopyPathProcessing(c *check.C) {
 			WORKDIR /wc2
 			WORKDIR /wc2
 			ADD wc2 c:/wc2
 			ADD wc2 c:/wc2
 			WORKDIR c:/
 			WORKDIR c:/
-			RUN sh -c "[ $(cat c:/wc1/wc1) = 'hellowc1' ]"
-			RUN sh -c "[ $(cat c:/wc2/wc2) = 'worldwc2' ]"
+			RUN sh -c "[ $(cat c:/wc1) = 'hellowc1' ]"
+			RUN sh -c "[ $(cat c:/wc2) = 'worldwc2' ]"
 
 
 			# Trailing slash on COPY/ADD, Windows-style path.
 			# Trailing slash on COPY/ADD, Windows-style path.
 			WORKDIR /wd1
 			WORKDIR /wd1
@@ -7172,31 +7176,6 @@ RUN echo vegeta
 	c.Assert(out, checker.Contains, "Step 3/3 : RUN echo vegeta")
 	c.Assert(out, checker.Contains, "Step 3/3 : RUN echo vegeta")
 }
 }
 
 
-// Verifies if COPY file . when WORKDIR is set to a non-existing directory,
-// the directory is created and the file is copied into the directory,
-// as opposed to the file being copied as a file with the name of the
-// directory. Fix for 27545 (found on Windows, but regression good for Linux too)
-func (s *DockerSuite) TestBuildCopyFileDotWithWorkdir(c *check.C) {
-	name := "testbuildcopyfiledotwithworkdir"
-
-	ctx, err := fakeContext(`FROM busybox
-WORKDIR /foo
-COPY file .
-RUN ["cat", "/foo/file"]
-`,
-		map[string]string{})
-	if err != nil {
-		c.Fatal(err)
-	}
-	defer ctx.Close()
-	if err := ctx.Add("file", "content"); err != nil {
-		c.Fatal(err)
-	}
-	if _, err = buildImageFromContext(name, ctx, true); err != nil {
-		c.Fatal(err)
-	}
-}
-
 func (s *DockerSuite) TestBuildSquashParent(c *check.C) {
 func (s *DockerSuite) TestBuildSquashParent(c *check.C) {
 	testRequires(c, ExperimentalDaemon)
 	testRequires(c, ExperimentalDaemon)
 	dockerFile := `
 	dockerFile := `