mirror of
				https://github.com/moby/moby.git
				synced 2022-11-09 12:21:53 -05:00 
			
		
		
		
	Tidy config/hostconfig structures
Signed-off-by: John Howard <jhoward@microsoft.com>
This commit is contained in:
		
							parent
							
								
									ad55d29c91
								
							
						
					
					
						commit
						ad5052df23
					
				
					 4 changed files with 55 additions and 47 deletions
				
			
		| 
						 | 
					@ -1 +1 @@
 | 
				
			||||||
sha256:fd6ebfedda8ea140a9380767e15bd32c6e899303cfe34bc4580c931f2f816f89
 | 
					sha256:731d62ca192955d38edd4333c89aad021002b1e570daa6bb9f8f06b500c76a4d
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,2 +1 @@
 | 
				
			||||||
{"architecture":"amd64","config":{"Hostname":"03797203757d","Domainname":"","User":"","AttachStdin":false,"AttachStdout":false,"AttachStderr":false,"Tty":false,"OpenStdin":false,"StdinOnce":false,"Env":["PATH=/go/bin:/usr/src/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin","GOLANG_VERSION=1.4.1","GOPATH=/go"],"Cmd":null,"Image":"ec3025ca8cc9bcab039e193e20ec647c2da3c53a74020f2ba611601f9b2c6c02","Volumes":null,"WorkingDir":"/go","Entrypoint":["/go/bin/dnsdock"],"OnBuild":[],"Labels":{}},"container":"d91be3479d5b1e84b0c00d18eea9dc777ca0ad166d51174b24283e2e6f104253","container_config":{"Hostname":"03797203757d","Domainname":"","User":"","AttachStdin":false,"AttachStdout":false,"AttachStderr":false,"Tty":false,"OpenStdin":false,"StdinOnce":false,"Env":["PATH=/go/bin:/usr/src/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin","GOLANG_VERSION=1.4.1","GOPATH=/go"],"Cmd":["/bin/sh","-c","#(nop) ENTRYPOINT [\"/go/bin/dnsdock\"]"],"Image":"ec3025ca8cc9bcab039e193e20ec647c2da3c53a74020f2ba611601f9b2c6c02","Volumes":null,"WorkingDir":"/go","Entrypoint":["/go/bin/dnsdock"],"OnBuild":[],"Labels":{}},"created":"2015-08-19T16:49:11.368300679Z","docker_version":"1.6.2","layer_id":"sha256:31176893850e05d308cdbfef88877e460d50c8063883fb13eb5753097da6422a","os":"linux","parent_id":"sha256:ec3025ca8cc9bcab039e193e20ec647c2da3c53a74020f2ba611601f9b2c6c02"}
 | 
					{"architecture":"amd64","config":{"AttachStdin":false,"AttachStdout":false,"AttachStderr":false,"Cmd":null,"Entrypoint":["/go/bin/dnsdock"],"Env":["PATH=/go/bin:/usr/src/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin","GOLANG_VERSION=1.4.1","GOPATH=/go"],"Hostname":"03797203757d","Image":"ec3025ca8cc9bcab039e193e20ec647c2da3c53a74020f2ba611601f9b2c6c02","Labels":{},"OnBuild":[],"OpenStdin":false,"StdinOnce":false,"Tty":false,"Volumes":null,"WorkingDir":"/go","Domainname":"","User":""},"container":"d91be3479d5b1e84b0c00d18eea9dc777ca0ad166d51174b24283e2e6f104253","container_config":{"AttachStdin":false,"AttachStdout":false,"AttachStderr":false,"Cmd":["/bin/sh","-c","#(nop) ENTRYPOINT [\"/go/bin/dnsdock\"]"],"Entrypoint":["/go/bin/dnsdock"],"Env":["PATH=/go/bin:/usr/src/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin","GOLANG_VERSION=1.4.1","GOPATH=/go"],"Hostname":"03797203757d","Image":"ec3025ca8cc9bcab039e193e20ec647c2da3c53a74020f2ba611601f9b2c6c02","Labels":{},"OnBuild":[],"OpenStdin":false,"StdinOnce":false,"Tty":false,"Volumes":null,"WorkingDir":"/go","Domainname":"","User":""},"created":"2015-08-19T16:49:11.368300679Z","docker_version":"1.6.2","layer_id":"sha256:31176893850e05d308cdbfef88877e460d50c8063883fb13eb5753097da6422a","os":"linux","parent_id":"sha256:ec3025ca8cc9bcab039e193e20ec647c2da3c53a74020f2ba611601f9b2c6c02"}
 | 
				
			||||||
 | 
					 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -17,28 +17,32 @@ import (
 | 
				
			||||||
// All fields added to this struct must be marked `omitempty` to keep getting
 | 
					// All fields added to this struct must be marked `omitempty` to keep getting
 | 
				
			||||||
// predictable hashes from the old `v1Compatibility` configuration.
 | 
					// predictable hashes from the old `v1Compatibility` configuration.
 | 
				
			||||||
type Config struct {
 | 
					type Config struct {
 | 
				
			||||||
	Hostname        string                // Hostname
 | 
					
 | 
				
			||||||
	Domainname      string                // Domainname
 | 
						// Applicable to all platforms
 | 
				
			||||||
	User            string                // User that will run the command(s) inside the container
 | 
					 | 
				
			||||||
	AttachStdin     bool                  // Attach the standard input, makes possible user interaction
 | 
						AttachStdin     bool                  // Attach the standard input, makes possible user interaction
 | 
				
			||||||
	AttachStdout    bool                  // Attach the standard output
 | 
						AttachStdout    bool                  // Attach the standard output
 | 
				
			||||||
	AttachStderr    bool                  // Attach the standard error
 | 
						AttachStderr    bool                  // Attach the standard error
 | 
				
			||||||
 | 
						Cmd             *stringutils.StrSlice // Command to run when starting the container
 | 
				
			||||||
 | 
						Entrypoint      *stringutils.StrSlice // Entrypoint to run when starting the container
 | 
				
			||||||
 | 
						Env             []string              // List of environment variable to set in the container
 | 
				
			||||||
	ExposedPorts    map[nat.Port]struct{} `json:",omitempty"` // List of exposed ports
 | 
						ExposedPorts    map[nat.Port]struct{} `json:",omitempty"` // List of exposed ports
 | 
				
			||||||
	PublishService  string                `json:",omitempty"` // Name of the network service exposed by the container
 | 
						Hostname        string                // Hostname
 | 
				
			||||||
	Tty             bool                  // Attach standard streams to a tty, including stdin if it is not closed.
 | 
						Image           string                // Name of the image as it was passed by the operator (eg. could be symbolic)
 | 
				
			||||||
 | 
						Labels          map[string]string     // List of labels set to this container
 | 
				
			||||||
 | 
						MacAddress      string                `json:",omitempty"` // Mac Address of the container
 | 
				
			||||||
 | 
						NetworkDisabled bool                  `json:",omitempty"` // Is network disabled (--net=none)
 | 
				
			||||||
 | 
						OnBuild         []string              // ONBUILD metadata that were defined on the image Dockerfile
 | 
				
			||||||
	OpenStdin       bool                  // Open stdin
 | 
						OpenStdin       bool                  // Open stdin
 | 
				
			||||||
	StdinOnce       bool                  // If true, close stdin after the 1 attached client disconnects.
 | 
						StdinOnce       bool                  // If true, close stdin after the 1 attached client disconnects.
 | 
				
			||||||
	Env             []string              // List of environment variable to set in the container
 | 
						Tty             bool                  // Attach standard streams to a tty, including stdin if it is not closed.
 | 
				
			||||||
	Cmd             *stringutils.StrSlice // Command to run when starting the container
 | 
					 | 
				
			||||||
	Image           string                // Name of the image as it was passed by the operator (eg. could be symbolic)
 | 
					 | 
				
			||||||
	Volumes         map[string]struct{}   // List of volumes (mounts) used for the container
 | 
						Volumes         map[string]struct{}   // List of volumes (mounts) used for the container
 | 
				
			||||||
	WorkingDir      string                // Current directory (PWD) in the command will be launched
 | 
						WorkingDir      string                // Current directory (PWD) in the command will be launched
 | 
				
			||||||
	Entrypoint      *stringutils.StrSlice // Entrypoint to run when starting the container
 | 
					
 | 
				
			||||||
	NetworkDisabled bool                  `json:",omitempty"` // Is network disabled
 | 
						// Applicable to UNIX platforms
 | 
				
			||||||
	MacAddress      string                `json:",omitempty"` // Mac Address of the container
 | 
						Domainname     string // Domainname
 | 
				
			||||||
	OnBuild         []string              // ONBUILD metadata that were defined on the image Dockerfile
 | 
						PublishService string `json:",omitempty"` // Name of the network service exposed by the container
 | 
				
			||||||
	Labels          map[string]string     // List of labels set to this container
 | 
						StopSignal     string `json:",omitempty"` // Signal to stop a container
 | 
				
			||||||
	StopSignal      string                `json:",omitempty"` // Signal to stop a container
 | 
						User           string // User that will run the command(s) inside the container
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// DecodeContainerConfig decodes a json encoded config into a ContainerConfigWrapper
 | 
					// DecodeContainerConfig decodes a json encoded config into a ContainerConfigWrapper
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -168,46 +168,51 @@ type LogConfig struct {
 | 
				
			||||||
// Here, "non-portable" means "dependent of the host we are running on".
 | 
					// Here, "non-portable" means "dependent of the host we are running on".
 | 
				
			||||||
// Portable information *should* appear in Config.
 | 
					// Portable information *should* appear in Config.
 | 
				
			||||||
type HostConfig struct {
 | 
					type HostConfig struct {
 | 
				
			||||||
	Binds             []string              // List of volume bindings for this container
 | 
						// Applicable to all platforms
 | 
				
			||||||
	ContainerIDFile   string                // File (path) where the containerId is written
 | 
						Binds           []string      // List of volume bindings for this container
 | 
				
			||||||
	Memory            int64                 // Memory limit (in bytes)
 | 
						ContainerIDFile string        // File (path) where the containerId is written
 | 
				
			||||||
	MemoryReservation int64                 // Memory soft limit (in bytes)
 | 
						CPUShares       int64         `json:"CpuShares"` // CPU shares (relative weight vs. other containers)
 | 
				
			||||||
	MemorySwap        int64                 // Total memory usage (memory + swap); set `-1` to disable swap
 | 
						LogConfig       LogConfig     // Configuration of the logs for this container
 | 
				
			||||||
	KernelMemory      int64                 // Kernel memory limit (in bytes)
 | 
						NetworkMode     NetworkMode   // Network mode to use for the container
 | 
				
			||||||
	CPUShares         int64                 `json:"CpuShares"` // CPU shares (relative weight vs. other containers)
 | 
						PortBindings    nat.PortMap   // Port mapping between the exposed port (container) and the host
 | 
				
			||||||
 | 
						RestartPolicy   RestartPolicy // Restart policy to be used for the container
 | 
				
			||||||
 | 
						VolumeDriver    string        // Name of the volume driver used to mount volumes
 | 
				
			||||||
 | 
						VolumesFrom     []string      // List of volumes to take from other container
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						// Applicable to UNIX platforms
 | 
				
			||||||
 | 
						BlkioWeight       uint16                // Block IO weight (relative weight vs. other containers)
 | 
				
			||||||
 | 
						CapAdd            *stringutils.StrSlice // List of kernel capabilities to add to the container
 | 
				
			||||||
 | 
						CapDrop           *stringutils.StrSlice // List of kernel capabilities to remove from the container
 | 
				
			||||||
 | 
						CgroupParent      string                // Parent cgroup.
 | 
				
			||||||
	CPUPeriod         int64                 `json:"CpuPeriod"` // CPU CFS (Completely Fair Scheduler) period
 | 
						CPUPeriod         int64                 `json:"CpuPeriod"` // CPU CFS (Completely Fair Scheduler) period
 | 
				
			||||||
 | 
						CPUQuota          int64                 `json:"CpuQuota"`  // CPU CFS (Completely Fair Scheduler) quota
 | 
				
			||||||
	CpusetCpus        string                // CpusetCpus 0-2, 0,1
 | 
						CpusetCpus        string                // CpusetCpus 0-2, 0,1
 | 
				
			||||||
	CpusetMems        string                // CpusetMems 0-2, 0,1
 | 
						CpusetMems        string                // CpusetMems 0-2, 0,1
 | 
				
			||||||
	CPUQuota          int64                 `json:"CpuQuota"` // CPU CFS (Completely Fair Scheduler) quota
 | 
						Devices           []DeviceMapping       // List of devices to map inside the container
 | 
				
			||||||
	BlkioWeight       uint16                // Block IO weight (relative weight vs. other containers)
 | 
					 | 
				
			||||||
	OomKillDisable    bool                  // Whether to disable OOM Killer or not
 | 
					 | 
				
			||||||
	MemorySwappiness  *int64                // Tuning container memory swappiness behaviour
 | 
					 | 
				
			||||||
	Privileged        bool                  // Is the container in privileged mode
 | 
					 | 
				
			||||||
	PortBindings      nat.PortMap           // Port mapping between the exposed port (container) and the host
 | 
					 | 
				
			||||||
	Links             []string              // List of links (in the name:alias form)
 | 
					 | 
				
			||||||
	PublishAllPorts   bool                  // Should docker publish all exposed port for the container
 | 
					 | 
				
			||||||
	DNS               []string              `json:"Dns"`        // List of DNS server to lookup
 | 
						DNS               []string              `json:"Dns"`        // List of DNS server to lookup
 | 
				
			||||||
	DNSOptions        []string              `json:"DnsOptions"` // List of DNSOption to look for
 | 
						DNSOptions        []string              `json:"DnsOptions"` // List of DNSOption to look for
 | 
				
			||||||
	DNSSearch         []string              `json:"DnsSearch"`  // List of DNSSearch to look for
 | 
						DNSSearch         []string              `json:"DnsSearch"`  // List of DNSSearch to look for
 | 
				
			||||||
	ExtraHosts        []string              // List of extra hosts
 | 
						ExtraHosts        []string              // List of extra hosts
 | 
				
			||||||
	VolumesFrom       []string              // List of volumes to take from other container
 | 
					 | 
				
			||||||
	Devices           []DeviceMapping       // List of devices to map inside the container
 | 
					 | 
				
			||||||
	NetworkMode       NetworkMode           // Network namespace to use for the container
 | 
					 | 
				
			||||||
	IpcMode           IpcMode               // IPC namespace to use for the container	// Unix specific
 | 
					 | 
				
			||||||
	PidMode           PidMode               // PID namespace to use for the container	// Unix specific
 | 
					 | 
				
			||||||
	UTSMode           UTSMode               // UTS namespace to use for the container	// Unix specific
 | 
					 | 
				
			||||||
	CapAdd            *stringutils.StrSlice // List of kernel capabilities to add to the container
 | 
					 | 
				
			||||||
	CapDrop           *stringutils.StrSlice // List of kernel capabilities to remove from the container
 | 
					 | 
				
			||||||
	GroupAdd          []string              // List of additional groups that the container process will run as
 | 
						GroupAdd          []string              // List of additional groups that the container process will run as
 | 
				
			||||||
	RestartPolicy     RestartPolicy         // Restart policy to be used for the container
 | 
						IpcMode           IpcMode               // IPC namespace to use for the container
 | 
				
			||||||
 | 
						KernelMemory      int64                 // Kernel memory limit (in bytes)
 | 
				
			||||||
 | 
						Links             []string              // List of links (in the name:alias form)
 | 
				
			||||||
 | 
						Memory            int64                 // Memory limit (in bytes)
 | 
				
			||||||
 | 
						MemoryReservation int64                 // Memory soft limit (in bytes)
 | 
				
			||||||
 | 
						MemorySwap        int64                 // Total memory usage (memory + swap); set `-1` to disable swap
 | 
				
			||||||
 | 
						MemorySwappiness  *int64                // Tuning container memory swappiness behaviour
 | 
				
			||||||
 | 
						OomKillDisable    bool                  // Whether to disable OOM Killer or not
 | 
				
			||||||
 | 
						PidMode           PidMode               // PID namespace to use for the container
 | 
				
			||||||
 | 
						Privileged        bool                  // Is the container in privileged mode
 | 
				
			||||||
 | 
						PublishAllPorts   bool                  // Should docker publish all exposed port for the container
 | 
				
			||||||
 | 
						ReadonlyRootfs    bool                  // Is the container root filesystem in read-only
 | 
				
			||||||
	SecurityOpt       []string              // List of string values to customize labels for MLS systems, such as SELinux.
 | 
						SecurityOpt       []string              // List of string values to customize labels for MLS systems, such as SELinux.
 | 
				
			||||||
	ReadonlyRootfs    bool                  // Is the container root filesystem in read-only	// Unix specific
 | 
					 | 
				
			||||||
	Ulimits           []*ulimit.Ulimit      // List of ulimits to be set in the container
 | 
						Ulimits           []*ulimit.Ulimit      // List of ulimits to be set in the container
 | 
				
			||||||
	LogConfig         LogConfig             // Configuration of the logs for this container
 | 
						UTSMode           UTSMode               // UTS namespace to use for the container
 | 
				
			||||||
	CgroupParent      string                // Parent cgroup.
 | 
					
 | 
				
			||||||
	ConsoleSize       [2]int                // Initial console size on Windows
 | 
						// Applicable to Windows
 | 
				
			||||||
	VolumeDriver      string                // Name of the volume driver used to mount volumes
 | 
						ConsoleSize [2]int         // Initial console size
 | 
				
			||||||
	Isolation         IsolationLevel        // Isolation level of the container (eg default, hyperv)
 | 
						Isolation   IsolationLevel // Isolation level of the container (eg default, hyperv)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// DecodeHostConfig creates a HostConfig based on the specified Reader.
 | 
					// DecodeHostConfig creates a HostConfig based on the specified Reader.
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue