Update layer apply to use containerd archive
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
This commit is contained in:
parent
0deba01621
commit
f0a43e72cd
2 changed files with 18 additions and 4 deletions
|
@ -1,13 +1,15 @@
|
|||
package rootfs
|
||||
|
||||
import (
|
||||
"context"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
|
||||
"github.com/docker/containerd"
|
||||
"github.com/docker/containerd/archive"
|
||||
"github.com/docker/containerd/log"
|
||||
"github.com/docker/containerd/snapshot"
|
||||
"github.com/docker/docker/pkg/archive"
|
||||
dockerarchive "github.com/docker/docker/pkg/archive"
|
||||
"github.com/opencontainers/go-digest"
|
||||
"github.com/opencontainers/image-spec/identity"
|
||||
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
|
||||
|
@ -56,7 +58,12 @@ func ApplyLayer(snapshots snapshot.Snapshotter, mounter Mounter, rd io.Reader, p
|
|||
}
|
||||
defer mounter.Unmount(mounts...)
|
||||
|
||||
if _, err := archive.ApplyLayer(key, rd); err != nil {
|
||||
rd, err = dockerarchive.DecompressStream(rd)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
if _, err := archive.ApplyDiffTar(context.Background(), key, rd); err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue