Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions pkg/compose/pull.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,32 @@ func (s *composeService) pull(ctx context.Context, project *types.Project, opts

i := 0
for name, service := range project.Services {
for j, vol := range service.Volumes {
if vol.Type != types.VolumeTypeImage {
continue
}

if _, ok := imagesBeingPulled[vol.Source]; ok {
continue
}
imagesBeingPulled[vol.Source] = name

volService := types.ServiceConfig{
Name: fmt.Sprintf("%s:volume %d", name, j),
Image: vol.Source,
}

eg.Go(func() error {
_, err := s.pullServiceImage(ctx, volService, opts.Quiet, project.Environment["DOCKER_DEFAULT_PLATFORM"])
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This unconditionally pulls types.VolumeTypeImage volume sources as external registry images, so docker compose pull --ignore-buildable still tries to pull a volume image that is actually produced by a buildable service in the same project, causing a regression for local/build-only images.

if err != nil {
s.events.On(errorEvent("Image "+vol.Source, getUnwrappedErrorMessage(err)))
if !opts.IgnoreFailures {
return err
}
}
return nil
})
}
if service.Image == "" {
s.events.On(api.Resource{
ID: name,
Expand Down