-
Notifications
You must be signed in to change notification settings - Fork 268
Add Podman support as fallback container runtime #6436
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
@copilot - the local ENV should be related to the local container runtime, not AZURE, consider better naming perhaps AZD_CONTAINER_RUNTIME "Add environment variable AZURE_CONTAINER_RUNTIME to specify alternative runtime" |
- Add support for Podman as an alternative container runtime - Implement automatic fallback from Docker to Podman - Add AZURE_CONTAINER_RUNTIME environment variable for explicit runtime selection - Update version checking to support Podman version format - Add comprehensive tests for Podman support - Update error messages to mention both Docker and Podman Co-authored-by: spboyer <7681382+spboyer@users.noreply.github.com>
Changed from AZURE_CONTAINER_RUNTIME to AZD_CONTAINER_RUNTIME to better reflect that this is a local azd tool configuration, not an Azure service configuration. Co-authored-by: spboyer <7681382+spboyer@users.noreply.github.com>
... Renamed the environment variable from |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds Podman support as a fallback container runtime for Azure Developer CLI, enabling users who have Podman installed but not Docker to use azd's container operations seamlessly.
Key Changes:
- Automatic runtime detection with Docker-first fallback to Podman
- Environment variable
AZD_CONTAINER_RUNTIMEfor explicit runtime selection - Version validation for Podman (requires ≥3.0 for Docker CLI compatibility)
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 8 comments.
| File | Description |
|---|---|
| cli/azd/pkg/tools/docker/docker.go | Adds Podman detection logic, version validation, and routes all container commands through detected runtime |
| cli/azd/pkg/tools/docker/docker_test.go | Adds comprehensive tests for Podman version parsing, runtime detection, and environment variable override behavior |
|
@copilot apply changes based on the comments in this thread |
- Make versionInfo runtime-aware with separate podmanVersionInfo() - Simplify error messages for service not running (consistent format) - Use t.Setenv() instead of os.Setenv/defer for test isolation - Update regex pattern to use \S+ for better clarity - Add test coverage for Podman versions with pre-release/build metadata - Add test for when neither Docker nor Podman is available - Keep getContainerEngine() backward compatible (defaults to docker) Co-authored-by: spboyer <7681382+spboyer@users.noreply.github.com>
Applied all review feedback in commit 46852b1:
|
Add Podman Support to Azure Developer CLI
This PR adds support for Podman as an alternative container runtime in Azure Developer CLI, addressing the issue where users without Docker but with Podman installed were unable to use azd's container functionality.
Changes Summary
AZD_CONTAINER_RUNTIMEenvironment variable for explicit runtime selectionKey Features
AZD_CONTAINER_RUNTIME=podmanor=dockerfor explicit controlUsage Examples
Testing
Files Modified
cli/azd/pkg/tools/docker/docker.go(+120, -18 lines)cli/azd/pkg/tools/docker/docker_test.go(+215 lines)Original prompt
💡 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.