mirror of https://github.com/docker/compose.git
Ensure images exist before starting progress display for network / volumes, otherwise progress display is all mixed up
Signed-off-by: Guillaume Tardif <guillaume.tardif@gmail.com>
This commit is contained in:
parent
53ee1418af
commit
d127cac6d4
|
@ -30,8 +30,11 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func (s *composeService) CreateOneOffContainer(ctx context.Context, project *types.Project, opts compose.RunOptions) (string, error) {
|
func (s *composeService) CreateOneOffContainer(ctx context.Context, project *types.Project, opts compose.RunOptions) (string, error) {
|
||||||
name := opts.Name
|
service, err := project.GetService(opts.Name)
|
||||||
service, err := project.GetService(name)
|
if err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
err = s.ensureImagesExists(ctx, project)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
@ -133,12 +136,7 @@ func updateOneOffServiceConfig(service *types.ServiceConfig, projectName string,
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *composeService) ensureRequiredServices(ctx context.Context, project *types.Project, service types.ServiceConfig) error {
|
func (s *composeService) ensureRequiredServices(ctx context.Context, project *types.Project, service types.ServiceConfig) error {
|
||||||
err := s.ensureImagesExists(ctx, project)
|
err := InDependencyOrder(ctx, project, func(c context.Context, svc types.ServiceConfig) error {
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
err = InDependencyOrder(ctx, project, func(c context.Context, svc types.ServiceConfig) error {
|
|
||||||
if svc.Name != service.Name { // only start dependencies, not service to run one-off
|
if svc.Name != service.Name { // only start dependencies, not service to run one-off
|
||||||
return s.ensureService(c, project, svc)
|
return s.ensureService(c, project, svc)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue