feat: prefer podman over docker as default container engine#106
Conversation
Introduce CONTAINER_ENGINE variable in Makefile that auto-detects podman first, falling back to docker. Update ci/build-push-image.sh detection order to match. Update README examples to use podman as the primary tool. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
WalkthroughThe PR makes Podman the preferred container engine over Docker across the Makefile, ChangesContainer Engine Preference: Podman over Docker
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 error, 1 warning)
✅ Passed checks (9 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@Makefile`:
- Around line 217-221: The image-e2e-multiarch and image-e2e-push-multiarch
targets use BuildKit-specific flags (--platform with buildx, --load, and --push)
that Podman does not support since Podman's buildx is just an alias for podman
build. Implement engine-specific logic by either creating separate conditional
targets or using a conditional check within each target that branches based on
the CONTAINER_ENGINE variable. For Podman, use native podman build commands
without the unsupported flags, or alternatively document and enforce that these
targets require Docker. For Docker, keep the existing buildx build commands with
the --platform, --load, and --push flags intact.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository: openshift-online/coderabbit/.coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 1afda74f-58c2-4b47-8e14-ba38d11f7529
📒 Files selected for processing (3)
MakefileREADME.mdci/build-push-image.sh
| $(CONTAINER_ENGINE) buildx build -f Containerfile.e2e \ | ||
| --platform $(PLATFORMS) \ | ||
| -t $(IMAGE_REPO)-e2e:$(IMAGE_TAG) \ | ||
| -t $(IMAGE_REPO)-e2e:$(GIT_SHA) \ | ||
| --load . |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== Inspect Makefile targets =="
rg -n -A8 -B2 '^(image-e2e-multiarch|test-e2e-container):' Makefile
echo
echo "== Check Podman buildx --load support (if podman exists) =="
if command -v podman >/dev/null 2>&1; then
podman buildx build --help | rg -n -- '--load|--manifest|--platform' || true
else
echo "podman not installed on this machine; skip runtime check."
fiRepository: openshift-online/rosa-regional-platform-api
Length of output: 1243
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== Check CONTAINER_ENGINE definition in Makefile =="
rg -n "CONTAINER_ENGINE\s*[?:=]" Makefile | head -20
echo
echo "== Check for Podman/Docker conditional logic =="
rg -n "podman|docker|CONTAINER_ENGINE" Makefile | head -30
echo
echo "== Look for related targets or workarounds =="
rg -n -B2 -A5 "buildx|--load" Makefile
echo
echo "== Check for any documentation about Podman compatibility =="
fd -t f "README|CONTRIBUTING|docs" -o -name "*podman*" -o -name "*docker*" 2>/dev/null | head -10
if [ -f "README.md" ]; then
echo "=== Checking README.md for Podman/Docker guidance ==="
rg -n -i "podman|docker.*buildx|--load" README.md || true
fiRepository: openshift-online/rosa-regional-platform-api
Length of output: 1956
🌐 Web query:
Podman buildx build --load incompatibility issues limitations
💡 Result:
The command podman buildx build is not a full implementation of the Docker buildx tool. Instead, it serves as a compatibility alias for the native podman build command [1][2][3]. Because of this design, several key limitations and incompatibility issues exist: 1. Alias Limitations: Podman does not natively integrate with BuildKit (the engine behind Docker's buildx) [4]. When you run podman buildx build, Podman simply executes its own build engine (Buildah) [1][5]. Consequently, many features exclusive to Docker's buildx (such as advanced builder drivers or specific BuildKit-only options) are either unavailable or strictly limited [1][6]. 2. --load Incompatibility: In Docker, --load is a shorthand for outputting to the local image store [7]. While Podman ignores or provides compatibility for some basic flags to prevent script failures [7][2], it does not support the full range of BuildKit-specific build outputs or the native BuildKit "container" driver behavior [4]. Because Podman does not use BuildKit, attempting to use advanced buildx workflows that rely on BuildKit's internal state—such as cross-platform building via --platform or complex build contexts—often fails or requires significant manual workarounds like exporting to OCI tarballs and using podman load [4][8][9]. 3. Feature Gaps: Users frequently encounter errors when scripts rely on other buildx features such as --push (which is shorthand for --output=type=registry) [6]. Since Podman does not implement these BuildKit-native flags, such commands will fail with "unknown flag" errors or simply remain unsupported [6]. 4. Workarounds: If your workflow requires BuildKit-specific features, you cannot rely on the podman buildx alias. Instead, you must use BuildKit directly (e.g., via buildctl) to produce OCI images or tarballs, and subsequently import those images into the Podman storage manually using podman load [4][8][9]. Alternatively, you should use native Podman commands (podman build) and adapt your CI/CD pipelines to avoid dependencies on Docker-specific buildx/BuildKit syntax [6].
Citations:
- 1: https://docs.podman.io/en/stable/markdown/podman-build.1.html
- 2: https://docs.podman.io/en/v5.6.1/markdown/podman-build.1.html
- 3: https://docs.podman.io/en/v5.5.2/markdown/podman-build.1.html
- 4: BuildKit fails to use local images with Podman backend moby/buildkit#5992
- 5: Alias build to buildx, so it won't fail podman-container-tools/podman#11134
- 6: [Bug]: Add support for "buildx build --push" and/or "buildx build --output=type=registry" podman-container-tools/podman#17339
- 7: Consider a very shallow 'buildx' "emulation mode" podman-container-tools/podman#11130
- 8: Additional build contexts should be sent as additional tar files podman-container-tools/podman#23433
- 9: podman load from buildctl using type oci results in incorrect name podman-container-tools/podman#12560
image-e2e-multiarch and image-e2e-push-multiarch targets fail with Podman.
The Makefile auto-selects Podman when available (line 28), but both multiarch targets use unsupported BuildKit-specific flags:
image-e2e-multiarch(lines 217–221) uses--load, which Podman does not supportimage-e2e-push-multiarch(lines 224–229) uses--push, which Podman does not support- Both use
--platformwithbuildx, a BuildKit-only feature unavailable in Podman
Podman's buildx is merely an alias for podman build and does not provide full Docker BuildKit compatibility. Implement engine-specific logic (e.g., conditional targets or a wrapper function) to use native Podman commands when Podman is selected, or fall back to Docker.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@Makefile` around lines 217 - 221, The image-e2e-multiarch and
image-e2e-push-multiarch targets use BuildKit-specific flags (--platform with
buildx, --load, and --push) that Podman does not support since Podman's buildx
is just an alias for podman build. Implement engine-specific logic by either
creating separate conditional targets or using a conditional check within each
target that branches based on the CONTAINER_ENGINE variable. For Podman, use
native podman build commands without the unsupported flags, or alternatively
document and enforce that these targets require Docker. For Docker, keep the
existing buildx build commands with the --platform, --load, and --push flags
intact.
|
/test |
|
/test rosa-regionality-compatibility-e2e |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jmelis, typeid The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
@jmelis: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
|
/retest-required |
3554c17
into
openshift-online:main
Summary
Test plan
make imageworks with podman installedmake imagefalls back to docker when podman is absent🤖 Generated with Claude Code
Summary by CodeRabbit
Documentation
Chores