Skip to content
Latchkey

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 Linux

Common 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

  1. Move the step into a job that uses runs-on: ubuntu-latest.
  2. If the work must run on Windows/macOS, find a JavaScript or composite equivalent of the action.
  3. 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@v1

How 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

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →