2015-11-18 17:18:07 -05:00
|
|
|
package tarexport
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/docker/docker/image"
|
|
|
|
"github.com/docker/docker/layer"
|
2015-12-04 16:55:15 -05:00
|
|
|
"github.com/docker/docker/reference"
|
2015-11-18 17:18:07 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
const (
|
|
|
|
manifestFileName = "manifest.json"
|
|
|
|
legacyLayerFileName = "layer.tar"
|
|
|
|
legacyConfigFileName = "json"
|
|
|
|
legacyVersionFileName = "VERSION"
|
|
|
|
legacyRepositoriesFileName = "repositories"
|
|
|
|
)
|
|
|
|
|
|
|
|
type manifestItem struct {
|
|
|
|
Config string
|
|
|
|
RepoTags []string
|
|
|
|
Layers []string
|
|
|
|
}
|
|
|
|
|
|
|
|
type tarexporter struct {
|
|
|
|
is image.Store
|
|
|
|
ls layer.Store
|
2015-12-04 16:55:15 -05:00
|
|
|
rs reference.Store
|
2015-11-18 17:18:07 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewTarExporter returns new ImageExporter for tar packages
|
2015-12-04 16:55:15 -05:00
|
|
|
func NewTarExporter(is image.Store, ls layer.Store, rs reference.Store) image.Exporter {
|
2015-11-18 17:18:07 -05:00
|
|
|
return &tarexporter{
|
|
|
|
is: is,
|
|
|
|
ls: ls,
|
2015-12-04 16:55:15 -05:00
|
|
|
rs: rs,
|
2015-11-18 17:18:07 -05:00
|
|
|
}
|
|
|
|
}
|