Skip to content

compose: adjust image load options for containerd storage#132

Draft
mike-sul wants to merge 3 commits intomainfrom
feat/image-load-progress-for-docker-v29
Draft

compose: adjust image load options for containerd storage#132
mike-sul wants to merge 3 commits intomainfrom
feat/image-load-progress-for-docker-v29

Conversation

@mike-sul
Copy link
Copy Markdown
Collaborator

Detect when the Docker daemon is backed by containerd snapshotter storage and apply compatible image load behavior.

When containerd storage is in use:

  • disable ReadBlobsFromStore since loading layers from an external blob directory is not supported
  • disable ProgressReporter because image load progress is not reported
  • return early after ImageLoad, skipping progress stream decoding

This prevents load failures and avoids misleading progress reporting when running against containerd-backed Docker engines.

Detect when the Docker daemon is backed by containerd snapshotter storage
and apply compatible image load behavior.

When containerd storage is in use:
- disable ReadBlobsFromStore since loading layers from an external blob
  directory is not supported
- disable ProgressReporter because image load progress is not reported
- return early after ImageLoad, skipping progress stream decoding

This prevents load failures and avoids misleading progress reporting when
running against containerd-backed Docker engines.

Signed-off-by: Mike Sul <mike.sul@foundries.io>
Add containerd-specific progress handling when loading images.

Since containerd-backed Docker engines do not emit standard layer progress
events, parse the ImageLoad response stream for "Loaded image:" messages
and translate them into image-level progress updates.

Changes include:
- add ImageLoadStateImageLoading state
- emit image loading/loaded progress for containerd image imports
- keep early return only when no ProgressReporter is configured
- update status printer to render image-level loading messages

This preserves user-visible progress feedback on containerd systems while
remaining compatible with standard Docker layer progress reporting.

Signed-off-by: Mike Sul <mike.sul@foundries.io>
Refactor LoadImages by extracting Docker-specific progress stream
handling into reportProgressIfDocker().

This removes the large state machine from LoadImages, reducing
cyclomatic complexity and making the main flow easier to follow.

Changes include:
- delegate Docker progress parsing to reportProgressIfDocker()
- keep containerd progress handling in reportProgressIfContainerd()
- simplify runtime branching between Docker and containerd paths

No functional changes intended.

Signed-off-by: Mike Sul <mike.sul@foundries.io>
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.

1 participant