Enable NoLchown

This caused to drop file permissions
This commit is contained in:
Ettore Di Giacinto
2021-03-18 10:48:23 +01:00
parent 4f1e4c0b41
commit f0a34f1cf0
2 changed files with 3 additions and 9 deletions

View File

@@ -71,7 +71,7 @@ func (c *Client) Unpack(image, dest string) error {
// Unpack the tarfile to the rootfs path.
// FROM: https://godoc.org/github.com/moby/moby/pkg/archive#TarOptions
if err := archive.Untar(content.NewReader(layer), dest, &archive.TarOptions{
NoLchown: true,
NoLchown: false,
ExcludePatterns: []string{"dev/"}, // prevent 'operation not permitted'
}); err != nil {
return fmt.Errorf("extracting tar for %s to directory %s failed: %v", desc.Digest.String(), dest, err)