mirror of
https://github.com/docker/compose.git
synced 2026-02-09 01:59:22 +08:00
warn user no service has been selected to build
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
committed by
Nicolas De loof
parent
aec9f54176
commit
c89b8a2d6b
@@ -61,6 +61,7 @@ func (s *composeService) build(ctx context.Context, project *types.Project, opti
|
||||
|
||||
// also include services used as additional_contexts with service: prefix
|
||||
options.Services = addBuildDependencies(options.Services, project)
|
||||
|
||||
// Some build dependencies we just introduced may not be enabled
|
||||
var err error
|
||||
project, err = project.WithServicesEnabled(options.Services...)
|
||||
@@ -85,10 +86,15 @@ func (s *composeService) build(ctx context.Context, project *types.Project, opti
|
||||
serviceToBuild[serviceName] = *service
|
||||
return nil
|
||||
}, policy)
|
||||
if err != nil || len(serviceToBuild) == 0 {
|
||||
if err != nil {
|
||||
return imageIDs, err
|
||||
}
|
||||
|
||||
if len(serviceToBuild) == 0 {
|
||||
logrus.Warn("No services to build")
|
||||
return imageIDs, nil
|
||||
}
|
||||
|
||||
bake, err := buildWithBake(s.dockerCli)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
Reference in New Issue
Block a user