| 651 | } |
| 652 | |
| 653 | func (s *composeService) checkOnlyBuildSection(project *types.Project) (bool, error) { |
| 654 | errorList := []string{} |
| 655 | for _, service := range project.Services { |
| 656 | if service.Image == "" && service.Build != nil { |
| 657 | errorList = append(errorList, service.Name) |
| 658 | } |
| 659 | } |
| 660 | if len(errorList) > 0 { |
| 661 | var errMsg strings.Builder |
| 662 | errMsg.WriteString("your Compose stack cannot be published as it only contains a build section for service(s):\n") |
| 663 | for _, serviceInError := range errorList { |
| 664 | fmt.Fprintf(&errMsg, "- %q\n", serviceInError) |
| 665 | } |
| 666 | return false, errors.New(errMsg.String()) |
| 667 | } |
| 668 | return true, nil |
| 669 | } |
| 670 | |
| 671 | func (s *composeService) checkForBindMount(project *types.Project) map[string][]types.ServiceVolumeConfig { |
| 672 | allFindings := map[string][]types.ServiceVolumeConfig{} |