diff --git a/README.md b/README.md index 94aea76..af52c83 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,19 @@ Note that the usage of Docker Desktop is subject to [Docker Desktop license agre After this step executes, Docker Desktop is ready and available, the docker CLI can be executed in subsequent "run" steps +## Choosing a runner + +Docker Desktop runs a Linux VM, so the runner needs enough CPU and memory or +`dockerd` can fail to finish starting and the action hangs waiting on the daemon. +At least 4 vCPUs and 16 GB of RAM is a good baseline. + +Watch out for `ubuntu-latest`: GitHub gives public repositories a 4 vCPU / 16 GB +runner, but private and internal repositories get a smaller 2 vCPU / 7 GB one, +and on that box `dockerd` often stalls during startup and never becomes ready. +If your repository is private or internal, pick a larger runner (e.g. a +[GitHub larger runner](https://docs.github.com/en/actions/using-github-hosted-runners/about-larger-runners) +with 4 vCPUs / 16 GB), not plain `ubuntu-latest`. + By default, the action downloads the last version of Docker Desktop. But you can specify another one by providing the build URL from where the action can download the specific version: ``` diff --git a/start/action.yml b/start/action.yml index 18ebae3..aecd64a 100644 --- a/start/action.yml +++ b/start/action.yml @@ -147,6 +147,18 @@ runs: - name: Wait for Docker to be up and running shell: bash run: | - until docker ps; do echo "docker not ready, sleep 10 s and try again"; sleep 10; done + deadline=$(( $(date +%s) + 600 )) + until timeout 60 docker ps >/dev/null 2>&1; do + if (( $(date +%s) >= deadline )); then + echo "::error::Docker did not become ready within 600s" + echo "----- host logs (incl. backend) -----" + cat ~/.docker/desktop/log/host/*.log 2>/dev/null || true + echo "----- vm logs (console) -----" + cat ~/.docker/desktop/log/vm/*.log 2>/dev/null || true + exit 1 + fi + echo "docker not ready, sleep 10 s and try again" + sleep 10 + done echo "Docker started and ready" docker version