GitHub Actions "Container action is only supported on Linux"
Docker container actions run inside a Linux container, so the runner OS must be Linux. Scheduling one on windows-latest or macos-latest fails before the step starts.
What this error means
A step that uses a Docker-based action fails immediately on a Windows or macOS runner with the message that container actions are only supported on Linux.
github-actions
Error: Container action is only supported on LinuxCommon causes
Docker action on a non-Linux runner
The action references a Dockerfile or image (runs.using: docker), but the job runs-on windows-latest or macos-latest, where Docker container actions are not available.
Matrix that spans OSes
A matrix mixes ubuntu with windows/macos and applies the same Docker action across all legs, so the non-Linux legs fail.
How to fix it
Run the container action on Linux
- Move the step into a job that uses runs-on: ubuntu-latest.
- If the work must run on Windows/macOS, find a JavaScript or composite equivalent of the action.
- For a matrix, gate the Docker step with an if on runner.os == "Linux".
.github/workflows/ci.yml
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: some-org/docker-action@v1How to prevent it
- Check an action's runs.using before adding it to a Windows/macOS job.
- Keep Docker-based steps in dedicated Linux jobs.
- Guard cross-OS matrix legs with runner.os conditions.
Related guides
GitHub Actions Docker Action "image platform does not match host"Fix GitHub Actions Docker-based action platform errors - an arm64 action image on an amd64 runner (or vice ve…
GitHub Actions "The runner is using an unsupported OS"Fix the GitHub Actions self-hosted error "The runner is using an unsupported operating system" so it can regi…
GitHub Actions Container Job Fails to Start - Image, Entrypoint, or VolumeFix GitHub Actions container job failures - a missing image, registry auth, an entrypoint that exits, or volu…