github.com/demonoid81/moby@v0.0.0-20200517203328-62dd8e17c460/api/types/swarm/container.go (about)

     1  package swarm // import "github.com/demonoid81/moby/api/types/swarm"
     2  
     3  import (
     4  	"time"
     5  
     6  	"github.com/demonoid81/moby/api/types/container"
     7  	"github.com/demonoid81/moby/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  // SELinuxContext contains the SELinux labels of the container.
    25  type SELinuxContext struct {
    26  	Disable bool
    27  
    28  	User  string
    29  	Role  string
    30  	Type  string
    31  	Level string
    32  }
    33  
    34  // CredentialSpec for managed service account (Windows only)
    35  type CredentialSpec struct {
    36  	Config   string
    37  	File     string
    38  	Registry string
    39  }
    40  
    41  // Privileges defines the security options for the container.
    42  type Privileges struct {
    43  	CredentialSpec *CredentialSpec
    44  	SELinuxContext *SELinuxContext
    45  }
    46  
    47  // ContainerSpec represents the spec of a container.
    48  type ContainerSpec struct {
    49  	Image           string                  `json:",omitempty"`
    50  	Labels          map[string]string       `json:",omitempty"`
    51  	Command         []string                `json:",omitempty"`
    52  	Args            []string                `json:",omitempty"`
    53  	Hostname        string                  `json:",omitempty"`
    54  	Env             []string                `json:",omitempty"`
    55  	Dir             string                  `json:",omitempty"`
    56  	User            string                  `json:",omitempty"`
    57  	Groups          []string                `json:",omitempty"`
    58  	Privileges      *Privileges             `json:",omitempty"`
    59  	Init            *bool                   `json:",omitempty"`
    60  	StopSignal      string                  `json:",omitempty"`
    61  	TTY             bool                    `json:",omitempty"`
    62  	OpenStdin       bool                    `json:",omitempty"`
    63  	ReadOnly        bool                    `json:",omitempty"`
    64  	Mounts          []mount.Mount           `json:",omitempty"`
    65  	StopGracePeriod *time.Duration          `json:",omitempty"`
    66  	Healthcheck     *container.HealthConfig `json:",omitempty"`
    67  	// The format of extra hosts on swarmkit is specified in:
    68  	// http://man7.org/linux/man-pages/man5/hosts.5.html
    69  	//    IP_address canonical_hostname [aliases...]
    70  	Hosts        []string            `json:",omitempty"`
    71  	DNSConfig    *DNSConfig          `json:",omitempty"`
    72  	Secrets      []*SecretReference  `json:",omitempty"`
    73  	Configs      []*ConfigReference  `json:",omitempty"`
    74  	Isolation    container.Isolation `json:",omitempty"`
    75  	PidsLimit    int64               `json:",omitempty"`
    76  	Sysctls      map[string]string   `json:",omitempty"`
    77  	Capabilities []string            `json:",omitempty"`
    78  }