2015-05-14 18:08:00 -04:00
|
|
|
package chrootarchive
|
|
|
|
|
2015-06-01 19:42:27 -04:00
|
|
|
import (
|
|
|
|
"io"
|
|
|
|
|
|
|
|
"github.com/docker/docker/pkg/archive"
|
2015-08-24 17:07:22 -04:00
|
|
|
"github.com/docker/docker/pkg/longpath"
|
2015-06-01 19:42:27 -04:00
|
|
|
)
|
|
|
|
|
2015-05-14 18:08:00 -04:00
|
|
|
// chroot is not supported by Windows
|
|
|
|
func chroot(path string) error {
|
|
|
|
return nil
|
|
|
|
}
|
2015-06-01 19:42:27 -04: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 17:07:22 -04:00
|
|
|
return archive.Unpack(decompressedArchive, longpath.AddPrefix(dest), options)
|
2015-06-01 19:42:27 -04:00
|
|
|
}
|