rootfs_unix.go 633 B

1234567891011121314151617181920212223
  1. // +build !windows
  2. package image
  3. import "github.com/docker/docker/layer"
  4. // RootFS describes images root filesystem
  5. // This is currently a placeholder that only supports layers. In the future
  6. // this can be made into a interface that supports different implementaions.
  7. type RootFS struct {
  8. Type string `json:"type"`
  9. DiffIDs []layer.DiffID `json:"diff_ids,omitempty"`
  10. }
  11. // ChainID returns the ChainID for the top layer in RootFS.
  12. func (r *RootFS) ChainID() layer.ChainID {
  13. return layer.CreateChainID(r.DiffIDs)
  14. }
  15. // NewRootFS returns empty RootFS struct
  16. func NewRootFS() *RootFS {
  17. return &RootFS{Type: "layers"}
  18. }