mirror of
https://github.com/docker/compose.git
synced 2026-10-20 19:02:47 +00:00
use '-' as separator by default for image name
Signed-off-by: Guillaume Lours <guillaume.lours@docker.com>
This commit is contained in:
parent
b49bd7c6ce
commit
150fd4b8cf
10 changed files with 41 additions and 41 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue