Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions .github/actions/dind-up-action/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ inputs:
default: 10s
wait-timeout:
default: "180"
dind-image:
description: "DinD image. Use a fixed version tag to avoid issues."
default: "docker:27-dind"

# --- NEW: Optional Setup & Verification Steps ---
cleanup-dind-on-start:
Expand Down Expand Up @@ -129,7 +132,11 @@ runs:

docker volume create --name "${STORAGE_VOL}" --label "com.github.dind=1" --label "com.github.repo=${GITHUB_REPOSITORY}" >/dev/null
docker volume create --name "${EXECROOT_VOL}" --label "com.github.dind=1" --label "com.github.repo=${GITHUB_REPOSITORY}" >/dev/null

# Clean up any existing DinD containers
docker ps -a -q --filter "label=com.github.dind=1" | xargs -r docker rm -f -v 2>/dev/null || true
docker rm -f -v "$NAME" 2>/dev/null || true
sleep 2

NET_ARGS=""
PUBLISH_ARGS="-p ${BIND}:${PORT}:${PORT}"
Expand All @@ -138,6 +145,8 @@ runs:
PUBLISH_ARGS=""
fi

IMAGE="${{ inputs.dind-image || 'docker:27-dind' }}"

docker run -d --privileged --name "$NAME" \
--cgroupns=host \
-e DOCKER_TLS_CERTDIR= \
Expand All @@ -152,10 +161,11 @@ runs:
--health-interval=${HI} \
--health-retries=${HR} \
--health-start-period=${HSP} \
docker:dind \
"${IMAGE}" \
--host=tcp://0.0.0.0:${PORT} \
--host=unix:///var/run/docker.sock \
--storage-driver=${SD} \
--iptables=false \
--exec-root=/execroot ${EXTRA}

{
Expand Down Expand Up @@ -233,7 +243,7 @@ runs:
set -euo pipefail
echo "Running port mapping smoke test..."
docker pull redis:7.2-alpine
cid=$(docker run -d -p 0:6379 --name redis-smoke redis:7-alpine)
cid=$(docker run -d -p 0:6379 --name redis-smoke redis:7.2-alpine)
hostport=$(docker port redis-smoke 6379/tcp | sed 's/.*://')
echo "Redis container started, mapped to host port ${hostport}"
echo "Probing connection to ${DIND_IP}:${hostport} ..."
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/beam_PreCommit_Python_Coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ jobs:
id: dind
if: contains(matrix.os, 'self-hosted')
with:
# Pin to stable Docker version to avoid compatibility issues
dind-image: "docker:27-dind"
# Enable all the new features
cleanup-dind-on-start: "true"
smoke-test-port-mapping: "true"
Expand Down
Loading