MCPcopy Create free account
hub / github.com/cloudfoundry/garden / ContainerSpec

Struct ContainerSpec

client.go:62–168  ·  view source on GitHub ↗

ContainerSpec specifies the parameters for creating a container. All parameters are optional.

Source from the content-addressed store, hash-verified

60
61// ContainerSpec specifies the parameters for creating a container. All parameters are optional.
62type ContainerSpec struct {
63
64 // Handle, if specified, is used to refer to the
65 // container in future requests. If it is not specified,
66 // garden uses its internal container ID as the container handle.
67 Handle string `json:"handle,omitempty"`
68
69 // GraceTime can be used to specify how long a container can go
70 // unreferenced by any client connection. After this time, the container will
71 // automatically be destroyed. If not specified, the container will be
72 // subject to the globally configured grace time.
73 GraceTime time.Duration `json:"grace_time,omitempty"`
74
75 // Deprecated in favour of Image property
76 RootFSPath string `json:"rootfs,omitempty"`
77
78 // Image contains a URI referring to the root file system for the container.
79 // The URI scheme must either be the empty string or "docker".
80 //
81 // A URI with an empty scheme determines the path of a root file system.
82 // If this path is empty, a default root file system is used.
83 // Other parts of the URI are ignored.
84 //
85 // A URI with scheme "docker" refers to a Docker image. The path in the URI
86 // (without the leading /) identifies a Docker image as the repository name
87 // in the default Docker registry. If a fragment is specified in the URI, this
88 // determines the tag associated with the image.
89 // If a host is specified in the URI, this determines the Docker registry to use.
90 // If no host is specified in the URI, a default Docker registry is used.
91 // Other parts of the URI are ignored.
92 //
93 // Examples:
94 // * "/some/path"
95 // * "docker:///onsi/grace-busybox"
96 // * "docker://index.docker.io/busybox"
97 Image ImageRef `json:"image,omitempty"`
98
99 // * bind_mounts: a list of mount point descriptions which will result in corresponding mount
100 // points being created in the container's file system.
101 //
102 // An error is returned if:
103 // * one or more of the mount points has a non-existent source directory, or
104 // * one or more of the mount points cannot be created.
105 BindMounts []BindMount `json:"bind_mounts,omitempty"`
106
107 // Network determines the subnet and IP address of a container.
108 //
109 // If not specified, a /30 subnet is allocated from a default network pool.
110 //
111 // If specified, it takes the form a.b.c.d/n where a.b.c.d is an IP address and n is the number of
112 // bits in the network prefix. a.b.c.d masked by the first n bits is the network address of a subnet
113 // called the subnet address. If the remaining bits are zero (i.e. a.b.c.d *is* the subnet address),
114 // the container is allocated an unused IP address from the subnet. Otherwise, the container is given
115 // the IP address a.b.c.d.
116 //
117 // The container IP address cannot be the subnet address or the broadcast address of the subnet
118 // (all non prefix bits set) or the address one less than the broadcast address (which is reserved).
119 //

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected