mirror of
https://github.com/docker/compose.git
synced 2025-07-23 05:34:36 +02:00
check if a missing image won't be build via a service declared in depends_on section
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
This commit is contained in:
parent
32f29b833f
commit
a9e070206e
@ -271,7 +271,7 @@ func (s *composeService) pullRequiredImages(ctx context.Context, project *types.
|
|||||||
eg.Go(func() error {
|
eg.Go(func() error {
|
||||||
id, err := s.pullServiceImage(ctx, service, info, s.configFile(), w, quietPull)
|
id, err := s.pullServiceImage(ctx, service, info, s.configFile(), w, quietPull)
|
||||||
pulledImages[i] = id
|
pulledImages[i] = id
|
||||||
if err != nil && service.Build != nil {
|
if err != nil && isServiceImageToBuild(service, project.Services) {
|
||||||
// image can be built, so we can ignore pull failure
|
// image can be built, so we can ignore pull failure
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@ -291,6 +291,19 @@ func (s *composeService) pullRequiredImages(ctx context.Context, project *types.
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func isServiceImageToBuild(service types.ServiceConfig, services []types.ServiceConfig) bool {
|
||||||
|
if service.Build != nil {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, depService := range services {
|
||||||
|
if depService.Image == service.Image && depService.Build != nil {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
func toPullProgressEvent(parent string, jm jsonmessage.JSONMessage, w progress.Writer) {
|
func toPullProgressEvent(parent string, jm jsonmessage.JSONMessage, w progress.Writer) {
|
||||||
if jm.ID == "" || jm.Progress == nil {
|
if jm.ID == "" || jm.Progress == nil {
|
||||||
return
|
return
|
||||||
|
Loading…
x
Reference in New Issue
Block a user