Skip to content

Commit f81e437

Browse files
SoManyHsallisaurus
authored andcommitted
Add more fields to ContainerConfig
These correspond to docker compose fields currently supported in V1/V2
1 parent 5553bf5 commit f81e437

File tree

2 files changed

+52
-19
lines changed

2 files changed

+52
-19
lines changed

ecs-cli/modules/cli/compose/containerconfig/containerconfig.go

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@ package containerconfig
33
import "github.com/aws/aws-sdk-go/service/ecs"
44

55
// ContainerConfig all compose fields supported by the ecs-cli
6-
// TODO: finalize fields
6+
// TODO: finalize fields (Note: Devices and HealthCheck not currently supported)
77
type ContainerConfig struct {
88
Name string
99

10-
CapAdd []string
11-
CapDrop []string
12-
Command []string
13-
Devices []string
10+
CapAdd []string
11+
CapDrop []string
12+
Command []string
13+
CPU int64
14+
// Devices []string
1415
DNSSearchDomains []string
1516
DNSServers []string
1617
DockerLabels map[string]*string
@@ -19,14 +20,20 @@ type ContainerConfig struct {
1920
Environment []*ecs.KeyValuePair
2021
ExtraHosts []string
2122
Hostname string
22-
HealthCheck *ecs.HealthCheck
23-
Image string
24-
Links []string
25-
LogConfiguration *ecs.LogConfiguration
26-
PortMappings []*ecs.PortMapping
27-
Privileged bool
28-
ReadOnly bool
29-
Tmpfs []string
30-
User string
31-
WorkingDirectory string
23+
// HealthCheck *ecs.HealthCheck
24+
Image string
25+
Links []string
26+
LogConfiguration *ecs.LogConfiguration
27+
Memory int64
28+
MemoryReservation int64
29+
MountPoints []*ecs.MountPoint
30+
PortMappings []*ecs.PortMapping
31+
Privileged bool
32+
ReadOnly bool
33+
ShmSize int64
34+
Tmpfs []string
35+
Ulimits []*ecs.Ulimit
36+
VolumesFrom []*ecs.VolumeFrom
37+
User string
38+
WorkingDirectory string
3239
}

ecs-cli/modules/utils/compose/convert_task_definition.go

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,36 @@ const (
4545

4646
// supported fields/options from compose YAML file
4747
var supportedComposeYamlOptions = []string{
48-
"cpu_shares", "command", "dns", "dns_search", "entrypoint", "env_file",
49-
"environment", "extra_hosts", "hostname", "image", "labels", "links",
50-
"logging", "log_driver", "log_opt", "mem_limit", "mem_reservation", "ports", "privileged", "read_only",
51-
"security_opt", "ulimits", "user", "volumes", "volumes_from", "working_dir", "cap_add", "cap_drop", "shm_size", "tmpfs",
48+
"cap_add",
49+
"cap_drop",
50+
"command",
51+
"cpu_shares",
52+
"dns",
53+
"dns_search",
54+
"entrypoint",
55+
"env_file",
56+
"environment",
57+
"extra_hosts",
58+
"hostname",
59+
"image",
60+
"labels",
61+
"links",
62+
"logging",
63+
"log_driver", // v1 only
64+
"log_opt", // v1 only
65+
"mem_limit",
66+
"mem_reservation",
67+
"ports",
68+
"privileged",
69+
"read_only",
70+
"security_opt",
71+
"shm_size",
72+
"tmpfs",
73+
"ulimits",
74+
"user",
75+
"volumes",
76+
"volumes_from",
77+
"working_dir",
5278
}
5379

5480
var supportedComposeYamlOptionsMap = getSupportedComposeYamlOptionsMap()

0 commit comments

Comments
 (0)