container.go 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. package swarm
  2. import (
  3. "time"
  4. "github.com/docker/docker/api/types/container"
  5. "github.com/docker/docker/api/types/mount"
  6. )
  7. // DNSConfig specifies DNS related configurations in resolver configuration file (resolv.conf)
  8. // Detailed documentation is available in:
  9. // http://man7.org/linux/man-pages/man5/resolv.conf.5.html
  10. // `nameserver`, `search`, `options` have been supported.
  11. // TODO: `domain` is not supported yet.
  12. type DNSConfig struct {
  13. // Nameservers specifies the IP addresses of the name servers
  14. Nameservers []string `json:",omitempty"`
  15. // Search specifies the search list for host-name lookup
  16. Search []string `json:",omitempty"`
  17. // Options allows certain internal resolver variables to be modified
  18. Options []string `json:",omitempty"`
  19. }
  20. // ContainerSpec represents the spec of a container.
  21. type ContainerSpec struct {
  22. Image string `json:",omitempty"`
  23. Labels map[string]string `json:",omitempty"`
  24. Command []string `json:",omitempty"`
  25. Args []string `json:",omitempty"`
  26. Hostname string `json:",omitempty"`
  27. Env []string `json:",omitempty"`
  28. Dir string `json:",omitempty"`
  29. User string `json:",omitempty"`
  30. Groups []string `json:",omitempty"`
  31. TTY bool `json:",omitempty"`
  32. Mounts []mount.Mount `json:",omitempty"`
  33. StopGracePeriod *time.Duration `json:",omitempty"`
  34. Healthcheck *container.HealthConfig `json:",omitempty"`
  35. DNSConfig *DNSConfig `json:",omitempty"`
  36. }