...

Source file src/github.com/openshift/api/image/dockerpre012/types_docker.go

Documentation: github.com/openshift/api/image/dockerpre012

     1  package dockerpre012
     2  
     3  import (
     4  	"time"
     5  
     6  	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
     7  )
     8  
     9  // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
    10  
    11  // DockerImage is for earlier versions of the Docker API (pre-012 to be specific). It is also the
    12  // version of metadata that the container image registry uses to persist metadata.
    13  //
    14  // Compatibility level 4: No compatibility is provided, the API can change at any point for any reason. These capabilities should not be used by applications needing long term support.
    15  // +openshift:compatibility-gen:level=4
    16  // +openshift:compatibility-gen:internal
    17  type DockerImage struct {
    18  	metav1.TypeMeta `json:",inline"`
    19  
    20  	ID              string        `json:"id"`
    21  	Parent          string        `json:"parent,omitempty"`
    22  	Comment         string        `json:"comment,omitempty"`
    23  	Created         metav1.Time   `json:"created"`
    24  	Container       string        `json:"container,omitempty"`
    25  	ContainerConfig DockerConfig  `json:"container_config,omitempty"`
    26  	DockerVersion   string        `json:"docker_version,omitempty"`
    27  	Author          string        `json:"author,omitempty"`
    28  	Config          *DockerConfig `json:"config,omitempty"`
    29  	Architecture    string        `json:"architecture,omitempty"`
    30  	Size            int64         `json:"size,omitempty"`
    31  }
    32  
    33  // DockerConfig is the list of configuration options used when creating a container.
    34  type DockerConfig struct {
    35  	Hostname        string              `json:"Hostname,omitempty"`
    36  	Domainname      string              `json:"Domainname,omitempty"`
    37  	User            string              `json:"User,omitempty"`
    38  	Memory          int64               `json:"Memory,omitempty"`
    39  	MemorySwap      int64               `json:"MemorySwap,omitempty"`
    40  	CPUShares       int64               `json:"CpuShares,omitempty"`
    41  	CPUSet          string              `json:"Cpuset,omitempty"`
    42  	AttachStdin     bool                `json:"AttachStdin,omitempty"`
    43  	AttachStdout    bool                `json:"AttachStdout,omitempty"`
    44  	AttachStderr    bool                `json:"AttachStderr,omitempty"`
    45  	PortSpecs       []string            `json:"PortSpecs,omitempty"`
    46  	ExposedPorts    map[string]struct{} `json:"ExposedPorts,omitempty"`
    47  	Tty             bool                `json:"Tty,omitempty"`
    48  	OpenStdin       bool                `json:"OpenStdin,omitempty"`
    49  	StdinOnce       bool                `json:"StdinOnce,omitempty"`
    50  	Env             []string            `json:"Env,omitempty"`
    51  	Cmd             []string            `json:"Cmd,omitempty"`
    52  	DNS             []string            `json:"Dns,omitempty"` // For Docker API v1.9 and below only
    53  	Image           string              `json:"Image,omitempty"`
    54  	Volumes         map[string]struct{} `json:"Volumes,omitempty"`
    55  	VolumesFrom     string              `json:"VolumesFrom,omitempty"`
    56  	WorkingDir      string              `json:"WorkingDir,omitempty"`
    57  	Entrypoint      []string            `json:"Entrypoint,omitempty"`
    58  	NetworkDisabled bool                `json:"NetworkDisabled,omitempty"`
    59  	SecurityOpts    []string            `json:"SecurityOpts,omitempty"`
    60  	OnBuild         []string            `json:"OnBuild,omitempty"`
    61  	// This field is not supported in pre012 and will always be empty.
    62  	Labels map[string]string `json:"Labels,omitempty"`
    63  }
    64  
    65  // ImagePre012 serves the same purpose as the Image type except that it is for
    66  // earlier versions of the Docker API (pre-012 to be specific)
    67  // Exists only for legacy conversion, copy of type from fsouza/go-dockerclient
    68  type ImagePre012 struct {
    69  	ID              string    `json:"id"`
    70  	Parent          string    `json:"parent,omitempty"`
    71  	Comment         string    `json:"comment,omitempty"`
    72  	Created         time.Time `json:"created"`
    73  	Container       string    `json:"container,omitempty"`
    74  	ContainerConfig Config    `json:"container_config,omitempty"`
    75  	DockerVersion   string    `json:"docker_version,omitempty"`
    76  	Author          string    `json:"author,omitempty"`
    77  	Config          *Config   `json:"config,omitempty"`
    78  	Architecture    string    `json:"architecture,omitempty"`
    79  	Size            int64     `json:"size,omitempty"`
    80  }
    81  
    82  // Config is the list of configuration options used when creating a container.
    83  // Config does not contain the options that are specific to starting a container on a
    84  // given host.  Those are contained in HostConfig
    85  // Exists only for legacy conversion, copy of type from fsouza/go-dockerclient
    86  type Config struct {
    87  	Hostname          string              `json:"Hostname,omitempty" yaml:"Hostname,omitempty"`
    88  	Domainname        string              `json:"Domainname,omitempty" yaml:"Domainname,omitempty"`
    89  	User              string              `json:"User,omitempty" yaml:"User,omitempty"`
    90  	Memory            int64               `json:"Memory,omitempty" yaml:"Memory,omitempty"`
    91  	MemorySwap        int64               `json:"MemorySwap,omitempty" yaml:"MemorySwap,omitempty"`
    92  	MemoryReservation int64               `json:"MemoryReservation,omitempty" yaml:"MemoryReservation,omitempty"`
    93  	KernelMemory      int64               `json:"KernelMemory,omitempty" yaml:"KernelMemory,omitempty"`
    94  	PidsLimit         int64               `json:"PidsLimit,omitempty" yaml:"PidsLimit,omitempty"`
    95  	CPUShares         int64               `json:"CpuShares,omitempty" yaml:"CpuShares,omitempty"`
    96  	CPUSet            string              `json:"Cpuset,omitempty" yaml:"Cpuset,omitempty"`
    97  	AttachStdin       bool                `json:"AttachStdin,omitempty" yaml:"AttachStdin,omitempty"`
    98  	AttachStdout      bool                `json:"AttachStdout,omitempty" yaml:"AttachStdout,omitempty"`
    99  	AttachStderr      bool                `json:"AttachStderr,omitempty" yaml:"AttachStderr,omitempty"`
   100  	PortSpecs         []string            `json:"PortSpecs,omitempty" yaml:"PortSpecs,omitempty"`
   101  	ExposedPorts      map[Port]struct{}   `json:"ExposedPorts,omitempty" yaml:"ExposedPorts,omitempty"`
   102  	StopSignal        string              `json:"StopSignal,omitempty" yaml:"StopSignal,omitempty"`
   103  	Tty               bool                `json:"Tty,omitempty" yaml:"Tty,omitempty"`
   104  	OpenStdin         bool                `json:"OpenStdin,omitempty" yaml:"OpenStdin,omitempty"`
   105  	StdinOnce         bool                `json:"StdinOnce,omitempty" yaml:"StdinOnce,omitempty"`
   106  	Env               []string            `json:"Env,omitempty" yaml:"Env,omitempty"`
   107  	Cmd               []string            `json:"Cmd" yaml:"Cmd"`
   108  	DNS               []string            `json:"Dns,omitempty" yaml:"Dns,omitempty"` // For Docker API v1.9 and below only
   109  	Image             string              `json:"Image,omitempty" yaml:"Image,omitempty"`
   110  	Volumes           map[string]struct{} `json:"Volumes,omitempty" yaml:"Volumes,omitempty"`
   111  	VolumeDriver      string              `json:"VolumeDriver,omitempty" yaml:"VolumeDriver,omitempty"`
   112  	VolumesFrom       string              `json:"VolumesFrom,omitempty" yaml:"VolumesFrom,omitempty"`
   113  	WorkingDir        string              `json:"WorkingDir,omitempty" yaml:"WorkingDir,omitempty"`
   114  	MacAddress        string              `json:"MacAddress,omitempty" yaml:"MacAddress,omitempty"`
   115  	Entrypoint        []string            `json:"Entrypoint" yaml:"Entrypoint"`
   116  	NetworkDisabled   bool                `json:"NetworkDisabled,omitempty" yaml:"NetworkDisabled,omitempty"`
   117  	SecurityOpts      []string            `json:"SecurityOpts,omitempty" yaml:"SecurityOpts,omitempty"`
   118  	OnBuild           []string            `json:"OnBuild,omitempty" yaml:"OnBuild,omitempty"`
   119  	Mounts            []Mount             `json:"Mounts,omitempty" yaml:"Mounts,omitempty"`
   120  	Labels            map[string]string   `json:"Labels,omitempty" yaml:"Labels,omitempty"`
   121  }
   122  
   123  // Mount represents a mount point in the container.
   124  //
   125  // It has been added in the version 1.20 of the Docker API, available since
   126  // Docker 1.8.
   127  // Exists only for legacy conversion, copy of type from fsouza/go-dockerclient
   128  type Mount struct {
   129  	Name        string
   130  	Source      string
   131  	Destination string
   132  	Driver      string
   133  	Mode        string
   134  	RW          bool
   135  }
   136  
   137  // Port represents the port number and the protocol, in the form
   138  // <number>/<protocol>. For example: 80/tcp.
   139  // Exists only for legacy conversion, copy of type from fsouza/go-dockerclient
   140  type Port string
   141  

View as plain text