dive/dive/image/docker/manifest.go

23 lines
410 B
Go
Raw Normal View History

2019-09-22 17:50:05 +02:00
package docker
import (
"encoding/json"
2019-09-22 17:50:05 +02:00
"github.com/sirupsen/logrus"
)
2019-10-03 15:42:27 +02:00
type manifest struct {
2019-09-22 17:50:05 +02:00
ConfigPath string `json:"Config"`
RepoTags []string `json:"RepoTags"`
LayerTarPaths []string `json:"Layers"`
}
2019-10-03 15:42:27 +02:00
func newManifest(manifestBytes []byte) manifest {
var manifest []manifest
2019-09-22 17:50:05 +02:00
err := json.Unmarshal(manifestBytes, &manifest)
if err != nil {
logrus.Panic(err)
}
return manifest[0]
}