2015-07-30 16:04:36 -04:00
|
|
|
package chrootarchive
|
|
|
|
|
2016-10-20 19:40:59 -04:00
|
|
|
import (
|
|
|
|
"io"
|
|
|
|
|
|
|
|
"github.com/docker/docker/pkg/archive"
|
|
|
|
)
|
2015-07-30 16:04:36 -04:00
|
|
|
|
|
|
|
// ApplyLayer parses a diff in the standard layer format from `layer`,
|
|
|
|
// and applies it to the directory `dest`. The stream `layer` can only be
|
|
|
|
// uncompressed.
|
|
|
|
// Returns the size in bytes of the contents of the layer.
|
2016-10-20 19:40:59 -04:00
|
|
|
func ApplyLayer(dest string, layer io.Reader) (size int64, err error) {
|
2015-10-08 11:51:41 -04:00
|
|
|
return applyLayerHandler(dest, layer, &archive.TarOptions{}, true)
|
2015-07-30 16:04:36 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
// ApplyUncompressedLayer parses a diff in the standard layer format from
|
|
|
|
// `layer`, and applies it to the directory `dest`. The stream `layer`
|
|
|
|
// can only be uncompressed.
|
|
|
|
// Returns the size in bytes of the contents of the layer.
|
2016-10-20 19:40:59 -04:00
|
|
|
func ApplyUncompressedLayer(dest string, layer io.Reader, options *archive.TarOptions) (int64, error) {
|
2015-10-08 11:51:41 -04:00
|
|
|
return applyLayerHandler(dest, layer, options, false)
|
2015-07-30 16:04:36 -04:00
|
|
|
}
|