| 378 | } |
| 379 | |
| 380 | func isServiceImageToBuild(service types.ServiceConfig, services types.Services) bool { |
| 381 | if service.Build != nil { |
| 382 | return true |
| 383 | } |
| 384 | |
| 385 | if service.Image == "" { |
| 386 | // N.B. this should be impossible as service must have either `build` or `image` (or both) |
| 387 | return false |
| 388 | } |
| 389 | |
| 390 | // look through the other services to see if another has a build definition for the same |
| 391 | // image name |
| 392 | for _, svc := range services { |
| 393 | if svc.Image == service.Image && svc.Build != nil { |
| 394 | return true |
| 395 | } |
| 396 | } |
| 397 | return false |
| 398 | } |
| 399 | |
| 400 | const ( |
| 401 | PreparingPhase = "Preparing" |