mirror of
https://github.com/docker/compose.git
synced 2025-07-27 15:44:08 +02:00
Set task tags
Signed-off-by: aiordache <anca.iordache@docker.com> Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
parent
f5703310ef
commit
cec3187bbb
@ -37,14 +37,29 @@ func Convert(project *types.Project, service types.ServiceConfig) (*ecs.TaskDefi
|
|||||||
fmt.Sprintf(" %s.local", project.Name),
|
fmt.Sprintf(" %s.local", project.Name),
|
||||||
}))
|
}))
|
||||||
|
|
||||||
|
tags := []tags.Tag{
|
||||||
|
{
|
||||||
|
Key: compose.ProjectTag,
|
||||||
|
Value: project.Name,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
Key: compose.ServiceTag,
|
||||||
|
Value: service.Name,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
tags = append(tags, toTags(service.Labels)...)
|
||||||
|
|
||||||
return &ecs.TaskDefinition{
|
return &ecs.TaskDefinition{
|
||||||
ContainerDefinitions: []ecs.TaskDefinition_ContainerDefinition{
|
ContainerDefinitions: []ecs.TaskDefinition_ContainerDefinition{
|
||||||
{
|
{
|
||||||
Command: service.Command,
|
Command: service.Command,
|
||||||
DisableNetworking: service.NetworkMode == "none",
|
DisableNetworking: service.NetworkMode == "none",
|
||||||
DnsSearchDomains: service.DNSSearch,
|
DnsSearchDomains: service.DNSSearch,
|
||||||
DnsServers: service.DNS,
|
DnsServers: service.DNS,
|
||||||
DockerLabels: nil,
|
DockerLabels: map[string]string{
|
||||||
|
compose.ProjectTag: project.Name,
|
||||||
|
compose.ServiceTag: service.Name,
|
||||||
|
},
|
||||||
DockerSecurityOptions: service.SecurityOpt,
|
DockerSecurityOptions: service.SecurityOpt,
|
||||||
EntryPoint: service.Entrypoint,
|
EntryPoint: service.Entrypoint,
|
||||||
Environment: toKeyValuePair(service.Environment),
|
Environment: toKeyValuePair(service.Environment),
|
||||||
@ -78,8 +93,9 @@ func Convert(project *types.Project, service types.ServiceConfig) (*ecs.TaskDefi
|
|||||||
SystemControls: toSystemControls(service.Sysctls),
|
SystemControls: toSystemControls(service.Sysctls),
|
||||||
Ulimits: toUlimits(service.Ulimits),
|
Ulimits: toUlimits(service.Ulimits),
|
||||||
User: service.User,
|
User: service.User,
|
||||||
VolumesFrom: nil,
|
|
||||||
WorkingDirectory: service.WorkingDir,
|
VolumesFrom: nil,
|
||||||
|
WorkingDirectory: service.WorkingDir,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Cpu: cpu,
|
Cpu: cpu,
|
||||||
@ -91,7 +107,7 @@ func Convert(project *types.Project, service types.ServiceConfig) (*ecs.TaskDefi
|
|||||||
PlacementConstraints: toPlacementConstraints(service.Deploy),
|
PlacementConstraints: toPlacementConstraints(service.Deploy),
|
||||||
ProxyConfiguration: nil,
|
ProxyConfiguration: nil,
|
||||||
RequiresCompatibilities: []string{ecsapi.LaunchTypeFargate},
|
RequiresCompatibilities: []string{ecsapi.LaunchTypeFargate},
|
||||||
Tags: toTags(service.Labels),
|
Tags: tags,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -219,6 +219,10 @@
|
|||||||
"Properties": {
|
"Properties": {
|
||||||
"ContainerDefinitions": [
|
"ContainerDefinitions": [
|
||||||
{
|
{
|
||||||
|
"DockerLabels": {
|
||||||
|
"com.docker.compose.project": "TestSimpleConvert",
|
||||||
|
"com.docker.compose.service": "simple"
|
||||||
|
},
|
||||||
"Environment": [
|
"Environment": [
|
||||||
{
|
{
|
||||||
"Name": "LOCALDOMAIN",
|
"Name": "LOCALDOMAIN",
|
||||||
@ -270,6 +274,16 @@
|
|||||||
"NetworkMode": "awsvpc",
|
"NetworkMode": "awsvpc",
|
||||||
"RequiresCompatibilities": [
|
"RequiresCompatibilities": [
|
||||||
"FARGATE"
|
"FARGATE"
|
||||||
|
],
|
||||||
|
"Tags": [
|
||||||
|
{
|
||||||
|
"Key": "com.docker.compose.project",
|
||||||
|
"Value": "TestSimpleConvert"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Key": "com.docker.compose.service",
|
||||||
|
"Value": "simple"
|
||||||
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"Type": "AWS::ECS::TaskDefinition"
|
"Type": "AWS::ECS::TaskDefinition"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user