Skip to content

Commit 50215d6

Browse files
authored
fix: detect podman-docker in CONTAINER_ENGINE resolution (#3620)
On systems with podman-docker installed, /usr/bin/docker is a shell wrapper that exec's podman. The previous default (CONTAINER_ENGINE=docker) caused the PID limit fix in cluster.sh to never fire, leading to PID exhaustion and containerd crashes under WASM workloads. Now common.sh detects the actual runtime via 'docker --version' output and falls back to podman when docker is absent. Assisted-by: 🤖 Claude Opus/Sonnet 4.6
1 parent e702867 commit 50215d6

1 file changed

Lines changed: 19 additions & 1 deletion

File tree

hack/common.sh

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,25 @@ populate_environment() {
4444
else
4545
export ARCH="$ARCH"
4646
fi
47-
export CONTAINER_ENGINE=${CONTAINER_ENGINE:-docker}
47+
# Resolve the actual container engine:
48+
# 1. Honour explicit CONTAINER_ENGINE if already set.
49+
# 2. Default to docker.
50+
# 3. If docker is actually podman (podman-docker package), switch to podman.
51+
# 4. If docker is absent but podman is present, use podman.
52+
if [[ -z "${CONTAINER_ENGINE:-}" ]]; then
53+
if command -v docker &>/dev/null; then
54+
CONTAINER_ENGINE=docker
55+
# Detect podman-docker: /usr/bin/docker is a wrapper that exec's podman.
56+
if docker --version 2>/dev/null | grep -qi podman; then
57+
CONTAINER_ENGINE=podman
58+
fi
59+
elif command -v podman &>/dev/null; then
60+
CONTAINER_ENGINE=podman
61+
else
62+
CONTAINER_ENGINE=docker
63+
fi
64+
fi
65+
export CONTAINER_ENGINE
4866
export TERM="${TERM:-dumb}"
4967

5068
echo "KUBECONFIG=${KUBECONFIG}"

0 commit comments

Comments
 (0)