github.com/zhuohuang-hust/src-cbuild@v0.0.0-20230105071821-c7aab3e7c840/api/types/swarm/container.go (about) 1 package swarm 2 3 import ( 4 "time" 5 6 "github.com/docker/docker/api/types/container" 7 "github.com/docker/docker/api/types/mount" 8 ) 9 10 // DNSConfig specifies DNS related configurations in resolver configuration file (resolv.conf) 11 // Detailed documentation is available in: 12 // http://man7.org/linux/man-pages/man5/resolv.conf.5.html 13 // `nameserver`, `search`, `options` have been supported. 14 // TODO: `domain` is not supported yet. 15 type DNSConfig struct { 16 // Nameservers specifies the IP addresses of the name servers 17 Nameservers []string `json:",omitempty"` 18 // Search specifies the search list for host-name lookup 19 Search []string `json:",omitempty"` 20 // Options allows certain internal resolver variables to be modified 21 Options []string `json:",omitempty"` 22 } 23 24 // ContainerSpec represents the spec of a container. 25 type ContainerSpec struct { 26 Image string `json:",omitempty"` 27 Labels map[string]string `json:",omitempty"` 28 Command []string `json:",omitempty"` 29 Args []string `json:",omitempty"` 30 Hostname string `json:",omitempty"` 31 Env []string `json:",omitempty"` 32 Dir string `json:",omitempty"` 33 User string `json:",omitempty"` 34 Groups []string `json:",omitempty"` 35 TTY bool `json:",omitempty"` 36 OpenStdin bool `json:",omitempty"` 37 Mounts []mount.Mount `json:",omitempty"` 38 StopGracePeriod *time.Duration `json:",omitempty"` 39 Healthcheck *container.HealthConfig `json:",omitempty"` 40 // The format of extra hosts on swarmkit is specified in: 41 // http://man7.org/linux/man-pages/man5/hosts.5.html 42 // IP_address canonical_hostname [aliases...] 43 Hosts []string `json:",omitempty"` 44 DNSConfig *DNSConfig `json:",omitempty"` 45 Secrets []*SecretReference `json:",omitempty"` 46 }