本文整理汇总了Golang中github.com/docker/docker/pkg/chrootarchive.UntarUncompressed函数的典型用法代码示例。如果您正苦于以下问题:Golang UntarUncompressed函数的具体用法?Golang UntarUncompressed怎么用?Golang UntarUncompressed使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了UntarUncompressed函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。
示例1: applyDiff
func (a *Driver) applyDiff(id string, diff archive.Reader) error {
dir := path.Join(a.rootPath(), "diff", id)
if err := chrootarchive.UntarUncompressed(diff, dir, &archive.TarOptions{
UIDMaps: a.uidMaps,
GIDMaps: a.gidMaps,
}); err != nil {
return err
}
// show invalid whiteouts warning.
files, err := ioutil.ReadDir(path.Join(dir, archive.WhiteoutLinkDir))
if err == nil && len(files) > 0 {
logrus.Warnf("Archive contains aufs hardlink references that are not supported.")
}
return nil
}
开发者ID:leobcn,项目名称:docker,代码行数:16,代码来源:aufs.go
示例2: ApplyDiff
// ApplyDiff extracts the changeset from the given diff into the
// layer with the specified id and parent, returning the size of the
// new layer in bytes.
// The archive.Reader must be an uncompressed stream.
func (d *Driver) ApplyDiff(id string, parent string, diff archive.Reader) (size int64, err error) {
dir := path.Join(physPath, id)
if err := chrootarchive.UntarUncompressed(diff, dir, nil); err != nil {
logrus.Warnf("Error while applying diff to %s: %v", id, err)
return 0, err
}
// show invalid whiteouts warning.
files, err := ioutil.ReadDir(path.Join(dir, archive.WhiteoutLinkDir))
if err == nil && len(files) > 0 {
logrus.Warnf("Archive contains aufs hardlink references that are not supported.")
}
return d.DiffSize(id, parent)
}
开发者ID:SuhasAnand,项目名称:openstorage,代码行数:20,代码来源:unionfs.go
示例3: applyDiff
func (a *Driver) applyDiff(id string, diff archive.Reader) error {
return chrootarchive.UntarUncompressed(diff, path.Join(a.rootPath(), "diff", id), &archive.TarOptions{
UIDMaps: a.uidMaps,
GIDMaps: a.gidMaps,
})
}
开发者ID:ungureanuvladvictor,项目名称:docker,代码行数:6,代码来源:aufs.go
示例4: applyDiff
func (a *Driver) applyDiff(id string, diff archive.ArchiveReader) error {
return chrootarchive.UntarUncompressed(diff, path.Join(a.rootPath(), "diff", id), nil)
}
开发者ID:vito,项目名称:garden-linux-release,代码行数:3,代码来源:aufs.go
注:本文中的github.com/docker/docker/pkg/chrootarchive.UntarUncompressed函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论