github.com/demonoid81/moby@v0.0.0-20200517203328-62dd8e17c460/pkg/chrootarchive/archive_windows.go (about)

     1  package chrootarchive // import "github.com/demonoid81/moby/pkg/chrootarchive"
     2  
     3  import (
     4  	"io"
     5  
     6  	"github.com/demonoid81/moby/pkg/archive"
     7  	"github.com/demonoid81/moby/pkg/longpath"
     8  )
     9  
    10  // chroot is not supported by Windows
    11  func chroot(path string) error {
    12  	return nil
    13  }
    14  
    15  func invokeUnpack(decompressedArchive io.ReadCloser,
    16  	dest string,
    17  	options *archive.TarOptions, root string) error {
    18  	// Windows is different to Linux here because Windows does not support
    19  	// chroot. Hence there is no point sandboxing a chrooted process to
    20  	// do the unpack. We call inline instead within the daemon process.
    21  	return archive.Unpack(decompressedArchive, longpath.AddPrefix(dest), options)
    22  }
    23  
    24  func invokePack(srcPath string, options *archive.TarOptions, root string) (io.ReadCloser, error) {
    25  	// Windows is different to Linux here because Windows does not support
    26  	// chroot. Hence there is no point sandboxing a chrooted process to
    27  	// do the pack. We call inline instead within the daemon process.
    28  	return archive.TarWithOptions(srcPath, options)
    29  }