mirror of https://github.com/docker/compose.git
Ensure images are pulled/build with build first, before creating networks / volumes and starting containers.
Will also avoid mixing build output and compose-cli progress display Signed-off-by: Guillame Tardif <guillaume.tardif@gmail.com>
This commit is contained in:
parent
c0805464f5
commit
bc9099de9b
|
@ -54,6 +54,10 @@ type composeService struct {
|
|||
}
|
||||
|
||||
func (s *composeService) Up(ctx context.Context, project *types.Project, detach bool) error {
|
||||
err := s.ensureImagesExists(ctx, project)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
for k, network := range project.Networks {
|
||||
if !network.External.External && network.Name != "" {
|
||||
network.Name = fmt.Sprintf("%s_%s", project.Name, k)
|
||||
|
@ -82,11 +86,6 @@ func (s *composeService) Up(ctx context.Context, project *types.Project, detach
|
|||
}
|
||||
}
|
||||
|
||||
err := s.ensureImagesExists(ctx, project)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
err = inDependencyOrder(ctx, project, func(c context.Context, service types.ServiceConfig) error {
|
||||
return s.ensureService(c, project, service)
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue