Skip to content

Add containerd detection and workaround for azd package failures#19

Closed
Copilot wants to merge 4 commits intomainfrom
copilot/fix-3-60052901-6308-48a3-92a3-3166a26b982b
Closed

Add containerd detection and workaround for azd package failures#19
Copilot wants to merge 4 commits intomainfrom
copilot/fix-3-60052901-6308-48a3-92a3-3166a26b982b

Conversation

Copy link

Copilot AI commented Jun 24, 2025

Problem

Customers using Docker Desktop with containerd image store enabled encounter failures when running azd package with easy-init/simplified-init flow. The error manifests as:

ERROR: failed to build: failed to write image to the following tags: [pack.local/builder/657662746b6877776b68:latest: saving image "pack.local/builder/657662746b6877776b68:latest": Error response from daemon: No such image: sha256:1a3f079e7ffed5eb4c02ecf6fdcc38c8fe459b021b4803471703dbded90181c4]

This occurs because containerd image store has compatibility issues with certain Docker build operations used by buildpacks.

Solution

This PR implements a detection mechanism and user-friendly workaround suggestion:

  1. Detection Method: Added IsContainerdEnabled() to detect when Docker is using containerd as the image store by checking docker info -f "{{ .DriverStatus }}" for the containerd driver signature.

  2. Error Pattern Matching: Added isContainerdBuildError() to identify the specific error pattern that occurs with containerd-related build failures.

  3. Helpful Suggestion: When both conditions are met (containerd error + containerd enabled), the code provides a clear suggestion to disable containerd in Docker Desktop settings.

Example Output

Before:

ERROR: building container: myapp at .: failed to build: failed to write image...

After (when containerd is detected):

ERROR: building container: myapp at .: failed to build: failed to write image...

SUGGESTION: Docker build failed with containerd image store enabled. Try disabling the containerd image store in Docker Desktop settings under 'Features in development' and run 'azd package' again

Testing

  • Added comprehensive test coverage for containerd detection
  • Added tests for error pattern matching and suggestion behavior
  • All existing tests continue to pass
  • Code follows repository standards (formatting, linting, spell checking)

Fixes Azure#3.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: JeffreyCA <9157833+JeffreyCA@users.noreply.github.com>
Copilot AI changed the title [WIP] [easy-init] simple node app - azd package fails with containerd enabled Add containerd detection and workaround for azd package failures Jun 25, 2025
Copilot AI requested a review from JeffreyCA June 25, 2025 00:00
@JeffreyCA JeffreyCA closed this Jun 27, 2025
@JeffreyCA JeffreyCA deleted the copilot/fix-3-60052901-6308-48a3-92a3-3166a26b982b branch June 27, 2025 21:47
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