2018-02-05 21:05:59 +00:00
|
|
|
package chrootarchive // import "github.com/docker/docker/pkg/chrootarchive"
|
2015-05-14 22:08:00 +00:00
|
|
|
|
2015-06-01 23:42:27 +00:00
|
|
|
import (
|
|
|
|
"io"
|
|
|
|
|
|
|
|
"github.com/docker/docker/pkg/archive"
|
2015-08-24 21:07:22 +00:00
|
|
|
"github.com/docker/docker/pkg/longpath"
|
2015-06-01 23:42:27 +00:00
|
|
|
)
|
|
|
|
|
2015-05-14 22:08:00 +00:00
|
|
|
// chroot is not supported by Windows
|
|
|
|
func chroot(path string) error {
|
|
|
|
return nil
|
|
|
|
}
|
2015-06-01 23:42:27 +00:00
|
|
|
|
|
|
|
func invokeUnpack(decompressedArchive io.ReadCloser,
|
|
|
|
dest string,
|
|
|
|
options *archive.TarOptions) error {
|
|
|
|
// Windows is different to Linux here because Windows does not support
|
|
|
|
// chroot. Hence there is no point sandboxing a chrooted process to
|
|
|
|
// do the unpack. We call inline instead within the daemon process.
|
2015-08-24 21:07:22 +00:00
|
|
|
return archive.Unpack(decompressedArchive, longpath.AddPrefix(dest), options)
|
2015-06-01 23:42:27 +00:00
|
|
|
}
|