@@ -138,33 +138,48 @@ type Container struct {
138
138
// From https://github.com/moby/moby/blob/8dbd90ec00daa26dc45d7da2431c965dec99e8b4/api/types/container/host_config.go#L391
139
139
// HostConfig the non-portable Config structure of a container.
140
140
type HostConfig struct {
141
- ExtraHosts []string // List of extra hosts
142
- PortBindings nat.PortMap // Port mapping between the exposed port (container) and the host
143
- LogConfig LoggerLogConfig // Configuration of the logs for this container
144
- BlkioWeight uint16 // Block IO weight (relative weight vs. other containers)
145
- CPUSetMems string `json:"CpusetMems"` // CpusetMems 0-2, 0,1
146
- CPUSetCPUs string `json:"CpusetCpus"` // CpusetCpus 0-2, 0,1
147
- CPUQuota int64 `json:"CpuQuota"` // CPU CFS (Completely Fair Scheduler) quota
148
- CPUShares uint64 `json:"CpuShares"` // CPU shares (relative weight vs. other containers)
149
- ContainerIDFile string // File (path) where the containerId is written
150
- GroupAdd []string // GroupAdd specifies additional groups to join
151
- IpcMode string `json:"IpcMode"` // IPC namespace to use for the container
152
- CgroupnsMode string // Cgroup namespace mode to use for the container
153
- Memory int64 // Memory limit (in bytes)
154
- MemorySwap int64 // Total memory usage (memory + swap); set `-1` to enable unlimited swap
155
- OomKillDisable bool // specifies whether to disable OOM Killer
156
- DNS []string `json:"Dns"` // List of DNS server to lookup
157
- DNSOptions []string `json:"DnsOptions"` // List of DNSOption to look for
158
- DNSSearch []string `json:"DnsSearch"` // List of DNSSearch to look for
159
- OomScoreAdj int // specifies the tune container’s OOM preferences (-1000 to 1000, rootless: 100 to 1000)
160
- ReadonlyRootfs bool // Is the container root filesystem in read-only
161
- UTSMode string // UTS namespace to use for the container
162
- ShmSize int64 // Size of /dev/shm in bytes. The size must be greater than 0.
163
- Sysctls map [string ]string // List of Namespaced sysctls used for the container
164
- Runtime string // Runtime to use with this container
165
- Devices []DeviceMapping // List of devices to map inside the container
166
- PidMode string // PID namespace to use for the container
167
- Tmpfs map [string ]string `json:"Tmpfs,omitempty"` // List of tmpfs (mounts) used for the container
141
+ // Binds []string // List of volume bindings for this container
142
+ ContainerIDFile string // File (path) where the containerId is written
143
+ LogConfig LoggerLogConfig // Configuration of the logs for this container
144
+ // NetworkMode NetworkMode // Network mode to use for the container
145
+ PortBindings nat.PortMap // Port mapping between the exposed port (container) and the host
146
+ // RestartPolicy RestartPolicy // Restart policy to be used for the container
147
+ // AutoRemove bool // Automatically remove container when it exits
148
+ // VolumeDriver string // Name of the volume driver used to mount volumes
149
+ // VolumesFrom []string // List of volumes to take from other container
150
+ // CapAdd strslice.StrSlice // List of kernel capabilities to add to the container
151
+ // CapDrop strslice.StrSlice // List of kernel capabilities to remove from the container
152
+
153
+ CgroupnsMode string // Cgroup namespace mode to use for the container
154
+ DNS []string `json:"Dns"` // List of DNS server to lookup
155
+ DNSOptions []string `json:"DnsOptions"` // List of DNSOption to look for
156
+ DNSSearch []string `json:"DnsSearch"` // List of DNSSearch to look for
157
+ ExtraHosts []string // List of extra hosts
158
+ GroupAdd []string // GroupAdd specifies additional groups to join
159
+ IpcMode string `json:"IpcMode"` // IPC namespace to use for the container
160
+ // Cgroup CgroupSpec // Cgroup to use for the container
161
+ OomScoreAdj int // specifies the tune container’s OOM preferences (-1000 to 1000, rootless: 100 to 1000)
162
+ PidMode string // PID namespace to use for the container
163
+ // Privileged bool // Is the container in privileged mode
164
+ // PublishAllPorts bool // Should docker publish all exposed port for the container
165
+ ReadonlyRootfs bool // Is the container root filesystem in read-only
166
+ // SecurityOpt []string // List of string values to customize labels for MLS systems, such as SELinux.
167
+ Tmpfs map [string ]string `json:"Tmpfs,omitempty"` // List of tmpfs (mounts) used for the container
168
+ UTSMode string // UTS namespace to use for the container
169
+ // UsernsMode UsernsMode // The user namespace to use for the container
170
+ ShmSize int64 // Size of /dev/shm in bytes. The size must be greater than 0.
171
+ Sysctls map [string ]string // List of Namespaced sysctls used for the container
172
+ Runtime string // Runtime to use with this container
173
+
174
+ BlkioWeight uint16 // Block IO weight (relative weight vs. other containers)
175
+ CPUSetMems string `json:"CpusetMems"` // CpusetMems 0-2, 0,1
176
+ CPUSetCPUs string `json:"CpusetCpus"` // CpusetCpus 0-2, 0,1
177
+ CPUQuota int64 `json:"CpuQuota"` // CPU CFS (Completely Fair Scheduler) quota
178
+ CPUShares uint64 `json:"CpuShares"` // CPU shares (relative weight vs. other containers)
179
+ Memory int64 // Memory limit (in bytes)
180
+ MemorySwap int64 // Total memory usage (memory + swap); set `-1` to enable unlimited swap
181
+ OomKillDisable bool // specifies whether to disable OOM Killer
182
+ Devices []DeviceMapping // List of devices to map inside the container
168
183
}
169
184
170
185
// From https://github.com/moby/moby/blob/v20.10.1/api/types/types.go#L416-L427
0 commit comments