Documentation
¶
Index ¶
- func ConvertToSwarmSpec(serviceName string, service *Service, stackName string) (*swarm.ServiceSpec, error)
- type BuildConfig
- type ComposeFile
- type Config
- type DeployConfig
- type DeviceRequest
- type DiscreteResourceSpec
- type GenericResource
- type HealthCheck
- type IPAMConfig
- type IPAMPool
- type LoggingConfig
- type Network
- type Placement
- type PlacementPreference
- type Platform
- type ResourceLimit
- type Resources
- type RestartPolicy
- type Secret
- type Service
- type UpdateConfig
- type Volume
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertToSwarmSpec ¶
func ConvertToSwarmSpec(serviceName string, service *Service, stackName string) (*swarm.ServiceSpec, error)
ConvertToSwarmSpec converts a compose service to Docker Swarm ServiceSpec
Types ¶
type BuildConfig ¶
type BuildConfig struct {
Context string `yaml:"context,omitempty"`
Dockerfile string `yaml:"dockerfile,omitempty"`
Args map[string]string `yaml:"args,omitempty"`
Target string `yaml:"target,omitempty"`
CacheFrom []string `yaml:"cache_from,omitempty"`
Labels map[string]string `yaml:"labels,omitempty"`
Network string `yaml:"network,omitempty"`
ShmSize string `yaml:"shm_size,omitempty"`
ExtraHosts []string `yaml:"extra_hosts,omitempty"`
}
type ComposeFile ¶
type ComposeFile struct {
Version string `yaml:"version"`
Services map[string]*Service `yaml:"services"`
Networks map[string]*Network `yaml:"networks,omitempty"`
Volumes map[string]*Volume `yaml:"volumes,omitempty"`
Secrets map[string]*Secret `yaml:"secrets,omitempty"`
Configs map[string]*Config `yaml:"configs,omitempty"`
}
ComposeFile represents the structure of a docker-compose.yml file
func ParseComposeFile ¶
func ParseComposeFile(path string) (*ComposeFile, error)
ParseComposeFile reads and parses a docker-compose.yml file
type DeployConfig ¶
type DeployConfig struct {
Mode string `yaml:"mode,omitempty"`
Replicas *int `yaml:"replicas,omitempty"`
Labels map[string]string `yaml:"labels,omitempty"`
UpdateConfig *UpdateConfig `yaml:"update_config,omitempty"`
RollbackConfig *UpdateConfig `yaml:"rollback_config,omitempty"`
Resources *Resources `yaml:"resources,omitempty"`
RestartPolicy *RestartPolicy `yaml:"restart_policy,omitempty"`
Placement *Placement `yaml:"placement,omitempty"`
EndpointMode string `yaml:"endpoint_mode,omitempty"`
}
type DeviceRequest ¶
type DiscreteResourceSpec ¶
type GenericResource ¶
type GenericResource struct {
DiscreteResourceSpec *DiscreteResourceSpec `yaml:"discrete_resource_spec,omitempty"`
}
type HealthCheck ¶
type IPAMConfig ¶
type LoggingConfig ¶
type Network ¶
type Network struct {
Driver string `yaml:"driver,omitempty"`
DriverOpts map[string]string `yaml:"driver_opts,omitempty"`
External interface{} `yaml:"external,omitempty"`
Labels map[string]string `yaml:"labels,omitempty"`
Attachable bool `yaml:"attachable,omitempty"`
Internal bool `yaml:"internal,omitempty"`
EnableIPv6 bool `yaml:"enable_ipv6,omitempty"`
IPAM *IPAMConfig `yaml:"ipam,omitempty"`
}
type Placement ¶
type Placement struct {
Constraints []string `yaml:"constraints,omitempty"`
Preferences []PlacementPreference `yaml:"preferences,omitempty"`
MaxReplicas int `yaml:"max_replicas_per_node,omitempty"`
Platforms []Platform `yaml:"platforms,omitempty"`
}
type PlacementPreference ¶
type PlacementPreference struct {
Spread string `yaml:"spread,omitempty"`
}
type ResourceLimit ¶
type ResourceLimit struct {
CPUs string `yaml:"cpus,omitempty"`
Memory string `yaml:"memory,omitempty"`
Pids int64 `yaml:"pids,omitempty"`
Devices []DeviceRequest `yaml:"devices,omitempty"`
GenericResources []GenericResource `yaml:"generic_resources,omitempty"`
}
type Resources ¶
type Resources struct {
Limits *ResourceLimit `yaml:"limits,omitempty"`
Reservations *ResourceLimit `yaml:"reservations,omitempty"`
}
type RestartPolicy ¶
type Service ¶
type Service struct {
Image string `yaml:"image,omitempty"`
Build *BuildConfig `yaml:"build,omitempty"`
Command interface{} `yaml:"command,omitempty"`
Entrypoint interface{} `yaml:"entrypoint,omitempty"`
Environment interface{} `yaml:"environment,omitempty"`
EnvFile interface{} `yaml:"env_file,omitempty"`
Ports []interface{} `yaml:"ports,omitempty"`
Expose []interface{} `yaml:"expose,omitempty"`
Volumes []interface{} `yaml:"volumes,omitempty"`
VolumesFrom []string `yaml:"volumes_from,omitempty"`
Networks interface{} `yaml:"networks,omitempty"`
Deploy *DeployConfig `yaml:"deploy,omitempty"`
DependsOn interface{} `yaml:"depends_on,omitempty"`
Labels map[string]string `yaml:"labels,omitempty"`
HealthCheck *HealthCheck `yaml:"healthcheck,omitempty"`
Secrets []interface{} `yaml:"secrets,omitempty"`
Configs []interface{} `yaml:"configs,omitempty"`
Hostname string `yaml:"hostname,omitempty"`
Domainname string `yaml:"domainname,omitempty"`
User string `yaml:"user,omitempty"`
WorkingDir string `yaml:"working_dir,omitempty"`
Privileged bool `yaml:"privileged,omitempty"`
Restart string `yaml:"restart,omitempty"`
StdinOpen bool `yaml:"stdin_open,omitempty"`
Tty bool `yaml:"tty,omitempty"`
ReadOnly bool `yaml:"read_only,omitempty"`
StopSignal string `yaml:"stop_signal,omitempty"`
StopGracePeriod string `yaml:"stop_grace_period,omitempty"`
Tmpfs interface{} `yaml:"tmpfs,omitempty"`
Ulimits map[string]interface{} `yaml:"ulimits,omitempty"`
DNS interface{} `yaml:"dns,omitempty"`
DNSSearch interface{} `yaml:"dns_search,omitempty"`
DNSOptions []string `yaml:"dns_opt,omitempty"`
ExtraHosts []string `yaml:"extra_hosts,omitempty"`
MacAddress string `yaml:"mac_address,omitempty"`
Logging *LoggingConfig `yaml:"logging,omitempty"`
CapAdd []string `yaml:"cap_add,omitempty"`
CapDrop []string `yaml:"cap_drop,omitempty"`
SecurityOpt []string `yaml:"security_opt,omitempty"`
StorageOpt map[string]string `yaml:"storage_opt,omitempty"`
Sysctls interface{} `yaml:"sysctls,omitempty"`
Isolation string `yaml:"isolation,omitempty"`
Init *bool `yaml:"init,omitempty"`
PidMode string `yaml:"pid,omitempty"`
IpcMode string `yaml:"ipc,omitempty"`
CgroupParent string `yaml:"cgroup_parent,omitempty"`
Devices []string `yaml:"devices,omitempty"`
Links []string `yaml:"links,omitempty"`
ExternalLinks []string `yaml:"external_links,omitempty"`
}
type UpdateConfig ¶
type UpdateConfig struct {
Parallelism int `yaml:"parallelism,omitempty"`
Delay string `yaml:"delay,omitempty"`
FailureAction string `yaml:"failure_action,omitempty"`
Monitor string `yaml:"monitor,omitempty"`
MaxFailureRatio float64 `yaml:"max_failure_ratio,omitempty"`
Order string `yaml:"order,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.