use '-' as separator by default for image name

Signed-off-by: Guillaume Lours <guillaume.lours@docker.com>
This commit is contained in:
Guillaume Lours 2022-07-29 18:55:22 +02:00
parent b49bd7c6ce
commit 150fd4b8cf
No known key found for this signature in database
10 changed files with 41 additions and 41 deletions

View file

@ -446,11 +446,14 @@ const (
UserCancel
)
// Separator is used for naming components
var Separator = "-"
// GetImageNameOrDefault computes the default image name for a service, used to tag built images
func GetImageNameOrDefault(service types.ServiceConfig, projectName string) string {
imageName := service.Image
if imageName == "" {
imageName = projectName + "_" + service.Name
imageName = projectName + Separator + service.Name
}
return imageName
}