2018-02-05 21:05:59 +00:00
|
|
|
package swarm // import "github.com/docker/docker/api/types/swarm"
|
2016-09-06 18:18:12 +00:00
|
|
|
|
|
|
|
import (
|
|
|
|
"time"
|
|
|
|
|
2016-10-13 18:28:32 +00:00
|
|
|
"github.com/docker/docker/api/types/container"
|
2016-09-06 18:18:12 +00:00
|
|
|
"github.com/docker/docker/api/types/mount"
|
2020-07-26 11:42:33 +00:00
|
|
|
"github.com/docker/go-units"
|
2016-09-06 18:18:12 +00:00
|
|
|
)
|
|
|
|
|
2016-10-20 00:07:44 +00:00
|
|
|
// DNSConfig specifies DNS related configurations in resolver configuration file (resolv.conf)
|
|
|
|
// Detailed documentation is available in:
|
|
|
|
// http://man7.org/linux/man-pages/man5/resolv.conf.5.html
|
|
|
|
// `nameserver`, `search`, `options` have been supported.
|
|
|
|
// TODO: `domain` is not supported yet.
|
|
|
|
type DNSConfig struct {
|
|
|
|
// Nameservers specifies the IP addresses of the name servers
|
|
|
|
Nameservers []string `json:",omitempty"`
|
|
|
|
// Search specifies the search list for host-name lookup
|
|
|
|
Search []string `json:",omitempty"`
|
|
|
|
// Options allows certain internal resolver variables to be modified
|
|
|
|
Options []string `json:",omitempty"`
|
|
|
|
}
|
|
|
|
|
2017-03-29 22:55:21 +00:00
|
|
|
// SELinuxContext contains the SELinux labels of the container.
|
|
|
|
type SELinuxContext struct {
|
|
|
|
Disable bool
|
|
|
|
|
|
|
|
User string
|
|
|
|
Role string
|
|
|
|
Type string
|
|
|
|
Level string
|
|
|
|
}
|
|
|
|
|
|
|
|
// CredentialSpec for managed service account (Windows only)
|
|
|
|
type CredentialSpec struct {
|
2019-02-01 14:33:27 +00:00
|
|
|
Config string
|
2017-03-29 22:55:21 +00:00
|
|
|
File string
|
|
|
|
Registry string
|
|
|
|
}
|
|
|
|
|
|
|
|
// Privileges defines the security options for the container.
|
|
|
|
type Privileges struct {
|
|
|
|
CredentialSpec *CredentialSpec
|
|
|
|
SELinuxContext *SELinuxContext
|
|
|
|
}
|
|
|
|
|
2016-09-06 18:18:12 +00:00
|
|
|
// ContainerSpec represents the spec of a container.
|
|
|
|
type ContainerSpec struct {
|
2016-10-13 18:28:32 +00:00
|
|
|
Image string `json:",omitempty"`
|
|
|
|
Labels map[string]string `json:",omitempty"`
|
|
|
|
Command []string `json:",omitempty"`
|
|
|
|
Args []string `json:",omitempty"`
|
2016-10-27 11:44:19 +00:00
|
|
|
Hostname string `json:",omitempty"`
|
2016-10-13 18:28:32 +00:00
|
|
|
Env []string `json:",omitempty"`
|
|
|
|
Dir string `json:",omitempty"`
|
|
|
|
User string `json:",omitempty"`
|
|
|
|
Groups []string `json:",omitempty"`
|
2017-03-29 22:55:21 +00:00
|
|
|
Privileges *Privileges `json:",omitempty"`
|
2018-06-01 10:47:38 +00:00
|
|
|
Init *bool `json:",omitempty"`
|
2017-02-06 05:22:57 +00:00
|
|
|
StopSignal string `json:",omitempty"`
|
2016-10-13 18:28:32 +00:00
|
|
|
TTY bool `json:",omitempty"`
|
2016-11-11 14:15:10 +00:00
|
|
|
OpenStdin bool `json:",omitempty"`
|
2017-01-14 08:12:19 +00:00
|
|
|
ReadOnly bool `json:",omitempty"`
|
2016-10-13 18:28:32 +00:00
|
|
|
Mounts []mount.Mount `json:",omitempty"`
|
|
|
|
StopGracePeriod *time.Duration `json:",omitempty"`
|
|
|
|
Healthcheck *container.HealthConfig `json:",omitempty"`
|
2016-11-03 15:05:00 +00:00
|
|
|
// The format of extra hosts on swarmkit is specified in:
|
|
|
|
// http://man7.org/linux/man-pages/man5/hosts.5.html
|
|
|
|
// IP_address canonical_hostname [aliases...]
|
2020-07-23 18:03:15 +00:00
|
|
|
Hosts []string `json:",omitempty"`
|
|
|
|
DNSConfig *DNSConfig `json:",omitempty"`
|
|
|
|
Secrets []*SecretReference `json:",omitempty"`
|
|
|
|
Configs []*ConfigReference `json:",omitempty"`
|
|
|
|
Isolation container.Isolation `json:",omitempty"`
|
|
|
|
Sysctls map[string]string `json:",omitempty"`
|
|
|
|
CapabilityAdd []string `json:",omitempty"`
|
|
|
|
CapabilityDrop []string `json:",omitempty"`
|
2020-07-26 11:42:33 +00:00
|
|
|
Ulimits []*units.Ulimit `json:",omitempty"`
|
2016-09-06 18:18:12 +00:00
|
|
|
}
|