mirror of
https://github.com/containers/skopeo.git
synced 2026-07-13 20:52:53 +00:00
Internalize the type declaration of a Docker image, so that we don't need to pull in code when we just want to know how to parse out a JSON object. Carry a copy of the license that covered the sources from which the definitions came. Signed-off-by: Nalin Dahyabhai <nalin@redhat.com> Closes: #75 Approved by: nalind
93 lines
3.5 KiB
Go
93 lines
3.5 KiB
Go
package docker
|
|
|
|
//
|
|
// Types extracted from Docker
|
|
//
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/docker/docker/api/types/container"
|
|
"github.com/opencontainers/go-digest"
|
|
)
|
|
|
|
// github.com/docker/docker/image/rootfs.go
|
|
const TypeLayers = "layers"
|
|
|
|
// github.com/docker/docker/image/rootfs.go
|
|
// RootFS describes images root filesystem
|
|
// This is currently a placeholder that only supports layers. In the future
|
|
// this can be made into an interface that supports different implementations.
|
|
type RootFS struct {
|
|
Type string `json:"type"`
|
|
DiffIDs []digest.Digest `json:"diff_ids,omitempty"`
|
|
}
|
|
|
|
// github.com/docker/docker/image/image.go
|
|
// History stores build commands that were used to create an image
|
|
type History struct {
|
|
// Created is the timestamp at which the image was created
|
|
Created time.Time `json:"created"`
|
|
// Author is the name of the author that was specified when committing the image
|
|
Author string `json:"author,omitempty"`
|
|
// CreatedBy keeps the Dockerfile command used while building the image
|
|
CreatedBy string `json:"created_by,omitempty"`
|
|
// Comment is the commit message that was set when committing the image
|
|
Comment string `json:"comment,omitempty"`
|
|
// EmptyLayer is set to true if this history item did not generate a
|
|
// layer. Otherwise, the history item is associated with the next
|
|
// layer in the RootFS section.
|
|
EmptyLayer bool `json:"empty_layer,omitempty"`
|
|
}
|
|
|
|
// github.com/docker/docker/image/image.go
|
|
// ID is the content-addressable ID of an image.
|
|
type ID digest.Digest
|
|
|
|
// github.com/docker/docker/image/image.go
|
|
// V1Image stores the V1 image configuration.
|
|
type V1Image struct {
|
|
// ID is a unique 64 character identifier of the image
|
|
ID string `json:"id,omitempty"`
|
|
// Parent is the ID of the parent image
|
|
Parent string `json:"parent,omitempty"`
|
|
// Comment is the commit message that was set when committing the image
|
|
Comment string `json:"comment,omitempty"`
|
|
// Created is the timestamp at which the image was created
|
|
Created time.Time `json:"created"`
|
|
// Container is the id of the container used to commit
|
|
Container string `json:"container,omitempty"`
|
|
// ContainerConfig is the configuration of the container that is committed into the image
|
|
ContainerConfig container.Config `json:"container_config,omitempty"`
|
|
// DockerVersion specifies the version of Docker that was used to build the image
|
|
DockerVersion string `json:"docker_version,omitempty"`
|
|
// Author is the name of the author that was specified when committing the image
|
|
Author string `json:"author,omitempty"`
|
|
// Config is the configuration of the container received from the client
|
|
Config *container.Config `json:"config,omitempty"`
|
|
// Architecture is the hardware that the image is build and runs on
|
|
Architecture string `json:"architecture,omitempty"`
|
|
// OS is the operating system used to build and run the image
|
|
OS string `json:"os,omitempty"`
|
|
// Size is the total size of the image including all layers it is composed of
|
|
Size int64 `json:",omitempty"`
|
|
}
|
|
|
|
// github.com/docker/docker/image/image.go
|
|
// Image stores the image configuration
|
|
type Image struct {
|
|
V1Image
|
|
Parent ID `json:"parent,omitempty"`
|
|
RootFS *RootFS `json:"rootfs,omitempty"`
|
|
History []History `json:"history,omitempty"`
|
|
OSVersion string `json:"os.version,omitempty"`
|
|
OSFeatures []string `json:"os.features,omitempty"`
|
|
|
|
// rawJSON caches the immutable JSON associated with this image.
|
|
rawJSON []byte
|
|
|
|
// computedID is the ID computed from the hash of the image config.
|
|
// Not to be confused with the legacy V1 ID in V1Image.
|
|
computedID ID
|
|
}
|