mirror of
https://github.com/docker/compose.git
synced 2025-07-21 04:34:38 +02:00
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 {
|
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 {
|
for k, network := range project.Networks {
|
||||||
if !network.External.External && network.Name != "" {
|
if !network.External.External && network.Name != "" {
|
||||||
network.Name = fmt.Sprintf("%s_%s", project.Name, k)
|
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 {
|
err = inDependencyOrder(ctx, project, func(c context.Context, service types.ServiceConfig) error {
|
||||||
return s.ensureService(c, project, service)
|
return s.ensureService(c, project, service)
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user