Reject compose file not setting service image

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
Nicolas De Loof 2020-07-07 11:50:42 +02:00
parent 4700fed836
commit 242216cab1
No known key found for this signature in database
GPG Key ID: 9858809D6F8F6E7E
2 changed files with 5 additions and 0 deletions

View File

@ -40,6 +40,7 @@ func (c *FargateCompatibilityChecker) CheckPortsPublished(p *types.ServicePortCo
}
if p.Published != p.Target {
c.Error("published port can't be set to a distinct value than container port")
p.Published = p.Target
}
}

View File

@ -17,6 +17,10 @@ import (
)
func Convert(project *types.Project, service types.ServiceConfig) (*ecs.TaskDefinition, error) {
if service.Image == "" {
return nil, fmt.Errorf("service %s doesn't define a Docker image to run", service.Name)
}
cpu, mem, err := toLimits(service)
if err != nil {
return nil, err