Skip to content

Add pull subcommand to fetch service images from a compose file - #142

Open
adrum wants to merge 2 commits into
Mcrich23:mainfrom
adrum:feat/compose-pull
Open

adrum wants to merge 2 commits into
Mcrich23:mainfrom
adrum:feat/compose-pull

Conversation

@adrum

@adrum adrum commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Pulls each resolved service's image, skipping build-only services (no image key) and images already present locally — mirroring the already-present match logic up uses (exact, registry-prefixed, or short reference). Passes the service's platform: through when set.

Resolves the project through the shared ComposeProjectOptions (#138) and fails fast on unknown service names per the #139 contract.

Pulls each resolved service's image, skipping build-only services (no
image key) and images already present locally — mirroring the
already-present match logic up uses (exact, registry-prefixed, or
short reference). Passes the service's platform: through when set.

Resolves the project through the shared ComposeProjectOptions (Mcrich23#138)
and fails fast on unknown service names per the Mcrich23#139 contract.
@Mcrich23

Mcrich23 commented Sep 9, 2026

Copy link
Copy Markdown
Owner

Thank you for adding this! Skipping images that already exist means pull can't update something like latest. Can you fix that and resolve variables in image names before pulling? Please also check service selection: we shouldn't automatically pull dependencies unless requested. A test of the pull behavior would be helpful.

…ted services

- Drop the already-present shortcut: refreshing a moving tag like
  :latest is the point of an explicit pull (up's implicit pull keeps
  the shortcut).
- Resolve ${VAR}/${VAR:-default} placeholders in image references
  from the environment file before pulling — a literal ${...} is not
  a valid registry reference.
- Pull only the requested services' images: the shared selection
  expands depends_on for up's sake, so explicit requests are narrowed
  back to the named services, with --include-deps to opt into the
  expanded set (matching docker compose pull).

Extracts pullTargets/resolvedImage as pure functions with unit
coverage for dependency narrowing, --include-deps, variable
resolution and defaults, and build-only services.
@adrum

adrum commented Sep 12, 2026

Copy link
Copy Markdown
Contributor Author

Fixed all three:

  • pull now always pulls (the skip was up's semantics, and it stays there)
  • image refs resolve ${VAR}/${VAR:-default} from the env file first
  • explicit pull <service> no longer drags in depends_on`. Added --include-deps to opt in to match docker compose

Also added united tests for each behavior.

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.

2 participants