Forráskód Böngészése

Merge pull request #18717 from anusha-ragunathan/rm-mount-bld-iface

Remove Mount/Unmount from Builder interface.
David Calavera 9 éve
szülő
commit
e21d06a972

+ 0 - 6
builder/builder.go

@@ -141,12 +141,6 @@ type Backend interface {
 	//ContainerCopy(name string, res string) (io.ReadCloser, error)
 	// TODO: use copyBackend api
 	BuilderCopy(containerID string, destPath string, src FileInfo, decompress bool) error
-
-	// TODO: remove
-	// Mount mounts the root filesystem for the container.
-	Mount(containerID string) error
-	// Unmount unmounts the root filesystem for the container.
-	Unmount(containerID string) error
 }
 
 // ImageCache abstracts an image cache store.

+ 0 - 3
builder/dockerfile/dispatchers.go

@@ -399,9 +399,6 @@ func run(b *Builder, args []string, attributes map[string]bool, original string)
 		return err
 	}
 
-	b.docker.Mount(cID)
-	defer b.docker.Unmount(cID)
-
 	if err := b.run(cID); err != nil {
 		return err
 	}

+ 0 - 8
builder/dockerfile/internals.go

@@ -66,10 +66,6 @@ func (b *Builder) commit(id string, autoCmd *stringutils.StrSlice, comment strin
 		if err != nil {
 			return err
 		}
-		if err := b.docker.Mount(id); err != nil {
-			return err
-		}
-		defer b.docker.Unmount(id)
 	}
 
 	// Note: Actually copy the struct
@@ -193,10 +189,6 @@ func (b *Builder) runContextCommand(args []string, allowRemote bool, allowLocalD
 	if err != nil {
 		return err
 	}
-	if err := b.docker.Mount(container.ID); err != nil {
-		return err
-	}
-	defer b.docker.Unmount(container.ID)
 	b.tmpContainers[container.ID] = struct{}{}
 
 	comment := fmt.Sprintf("%s %s in %s", cmdName, origPaths, dest)

+ 6 - 19
daemon/daemonbuilder/builder.go

@@ -112,6 +112,12 @@ func (d Docker) BuilderCopy(cID string, destPath string, src builder.FileInfo, d
 	if err != nil {
 		return err
 	}
+	err = d.Daemon.Mount(c)
+	if err != nil {
+		return err
+	}
+	defer d.Daemon.Unmount(c)
+
 	dest, err := c.GetResourcePath(destPath)
 	if err != nil {
 		return err
@@ -176,25 +182,6 @@ func (d Docker) BuilderCopy(cID string, destPath string, src builder.FileInfo, d
 	return fixPermissions(srcPath, destPath, rootUID, rootGID, destExists)
 }
 
-// Mount mounts the root filesystem for the container.
-func (d Docker) Mount(cID string) error {
-	c, err := d.Daemon.GetContainer(cID)
-	if err != nil {
-		return err
-	}
-	return d.Daemon.Mount(c)
-}
-
-// Unmount unmounts the root filesystem for the container.
-func (d Docker) Unmount(cID string) error {
-	c, err := d.Daemon.GetContainer(cID)
-	if err != nil {
-		return err
-	}
-	d.Daemon.Unmount(c)
-	return nil
-}
-
 // GetCachedImage returns a reference to a cached image whose parent equals `parent`
 // and runconfig equals `cfg`. A cache miss is expected to return an empty ID and a nil error.
 func (d Docker) GetCachedImage(imgID string, cfg *runconfig.Config) (string, error) {