Use chrootarchive for plugin rootfs

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: 6f3f907cdba0ba1aa4eb1320595d155bab3467af
Component: engine
This commit is contained in:
Tonis Tiigi
2017-05-18 14:53:46 -07:00
parent 4b438a3414
commit 14bb0faf0c
+2 -1
View File
@@ -12,6 +12,7 @@ import (
"github.com/docker/docker/image"
"github.com/docker/docker/layer"
"github.com/docker/docker/pkg/archive"
"github.com/docker/docker/pkg/chrootarchive"
"github.com/docker/docker/pkg/progress"
"github.com/opencontainers/go-digest"
"github.com/pkg/errors"
@@ -143,7 +144,7 @@ func (dm *downloadManager) Download(ctx context.Context, initialRootFS image.Roo
return initialRootFS, nil, err
}
digester := digest.Canonical.Digester()
if _, err := archive.ApplyLayer(dm.tmpDir, io.TeeReader(inflatedLayerData, digester.Hash())); err != nil {
if _, err := chrootarchive.ApplyLayer(dm.tmpDir, io.TeeReader(inflatedLayerData, digester.Hash())); err != nil {
return initialRootFS, nil, err
}
initialRootFS.Append(layer.DiffID(digester.Digest()))