Skip to content

Pull images used in volumes with type=image#13811

Open
Divyanshupandey007 wants to merge 1 commit into
docker:mainfrom
Divyanshupandey007:13809-pull-volume-images
Open

Pull images used in volumes with type=image#13811
Divyanshupandey007 wants to merge 1 commit into
docker:mainfrom
Divyanshupandey007:13809-pull-volume-images

Conversation

@Divyanshupandey007
Copy link
Copy Markdown

@Divyanshupandey007 Divyanshupandey007 commented May 24, 2026

Description

When running docker compose pull, images referenced in volume mounts with
type=image were not being pulled. Only the main service images (service.Image)
were considered.
The pullRequiredImages() function (used by docker compose up) already handled
this case by iterating through service volumes and creating fake ServiceConfig
entries for volume images. However, the pull() function (used by docker compose pull)
did not have this logic.
This adds the same volume image discovery to the pull() function so that
docker compose pull also pulls images referenced in type=image volume mounts.

Changes

  • pkg/compose/pull.go: Added a loop in pull() that iterates each service's
    volumes, checks for type=image, deduplicates against imagesBeingPulled, and
    queues them for pulling via pullServiceImage().

How to test

services:
  nginx:
    image: "nginx:alpine"
    volumes:
      - type: image
        source: mattfly/obsidian:latest
        target: /srv/http/ObsidianIRC
        image:
          subpath: usr/share/nginx/html/

Fixes #13809

When running 'docker compose pull', images referenced in volume
mounts with type=image were not being pulled. The pull() function
only iterated service images, while pullRequiredImages() (used by
'docker compose up') already handled volume images.

This adds the same volume image discovery logic to the pull()
function, so that 'docker compose pull' also pulls images used
in type=image volume mounts.

Fixes docker#13809

Signed-off-by: Divyanshu Pandey <pandey.divyanshu03@gmail.com>
@Divyanshupandey007 Divyanshupandey007 requested a review from a team as a code owner May 24, 2026 08:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] docker compose pull does not update images that are used in volumes with type=image

1 participant