Skip to content

Instantly share code, notes, and snippets.

@ngtuna
Last active March 19, 2016 23:30
Show Gist options
  • Save ngtuna/c84d59b497bca62e2e9f to your computer and use it in GitHub Desktop.
Save ngtuna/c84d59b497bca62e2e9f to your computer and use it in GitHub Desktop.
New ServiceConfig struct for composefile v2.
type Build struct {
Context string `yaml:"context, omitempty"`
Dockerfile string `yaml:"context, omitempty"`
Args MaporEqualSlice `yaml:"args, omitempty"`
}
type Log struct {
Driver strings `yaml:"driver, omitempty"`
options MaporColonSlice `yaml:"options, omitempty"`
}
// ServiceConfig version 2 holds libcompose service configuration
type ServiceConfigV2 struct {
Build Build `yaml:"build,omitempty"`
CapAdd []string `yaml:"cap_add,omitempty"`
CapDrop []string `yaml:"cap_drop,omitempty"`
CPUSet string `yaml:"cpuset,omitempty"`
CPUShares int64 `yaml:"cpu_shares,omitempty"`
CPUQuota int64 `yaml:"cpu_quota,omitempty"`
Command Command `yaml:"command,flow,omitempty"`
CgroupParrent string `yaml:"cgroup_parrent,omitempty"`
ContainerName string `yaml:"container_name,omitempty"`
Devices []string `yaml:"devices,omitempty"`
DependsOn []string `yaml:"depends_on,omitempty"`
DNS Stringorslice `yaml:"dns,omitempty"`
DNSSearch Stringorslice `yaml:"dns_search,omitempty"`
DomainName string `yaml:"domain_name,omitempty"`
Entrypoint Command `yaml:"entrypoint,flow,omitempty"`
EnvFile Stringorslice `yaml:"env_file,omitempty"`
Environment MaporEqualSlice `yaml:"environment,omitempty"`
Expose []string `yaml:"expose,omitempty"`
Extends MaporEqualSlice `yaml:"extends,omitempty"`
ExternalLinks []string `yaml:"external_links,omitempty"`
ExtraHosts []string `yaml:"extra_hosts,omitempty"`
Image string `yaml:"image,omitempty"`
Hostname string `yaml:"hostname,omitempty"`
Ipc string `yaml:"ipc,omitempty"`
Labels SliceorMap `yaml:"labels,omitempty"`
Links MaporColonSlice `yaml:"links,omitempty"`
Logging Log `yaml:"logging,omitempty"`
MacAddress string `yaml:"mac_address,omitempty"`
MemLimit int64 `yaml:"mem_limit,omitempty"`
MemSwapLimit int64 `yaml:"memswap_limit,omitempty"`
NetworkMode string `yaml:"network_mode,omitempty"`
//FIXME: consider to add aliases to networks
Networks []string `yaml:"networks,omitempty"`
Pid string `yaml:"pid,omitempty"`
Ports []string `yaml:"ports,omitempty"`
Privileged bool `yaml:"privileged,omitempty"`
SecurityOpt []string `yaml:"security_opt,omitempty"`
StopSignal string `yaml:"stop_signal,omitempty"`
//FIXME: ulimits is not exacly a string or slice of strings
Ulimits []string `yaml:"ulimits,omitempty"`
VolumeDriver string `yaml:"volume_driver,omitempty"`
Volumes []string `yaml:"volumes,omitempty"`
VolumesFrom []string `yaml:"volumes_from,omitempty"`
Uts string `yaml:"uts,omitempty"`
Restart string `yaml:"restart,omitempty"`
ReadOnly bool `yaml:"read_only,omitempty"`
StdinOpen bool `yaml:"stdin_open,omitempty"`
Tty bool `yaml:"tty,omitempty"`
User string `yaml:"user,omitempty"`
WorkingDir string `yaml:"working_dir,omitempty"`
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment