Skip to content
Latchkey

GitHub Actions Container Job "options" Invalid or Ignored

A container job sets jobs.<id>.container.options with docker run flags, but the option is unsupported, conflicts with how Actions manages the container, or is silently ignored.

What this error means

The container job fails during "Initialize containers" with a docker error about an unrecognized or conflicting option, or the option appears to have no effect at runtime.

.github/workflows/ci.yml
jobs:
  test:
    container:
      image: node:20
      options: --network host --entrypoint /bin/sh   # --entrypoint conflicts with Actions
    runs-on: ubuntu-latest

Common causes

Flag conflicts with Actions container management

Actions controls the entrypoint, working directory, and volume mounts so steps can run inside the container. Overriding --entrypoint or the workdir via options breaks step execution.

Unsupported or malformed docker option

options is passed to docker create. An unknown flag, a typo, or a flag not allowed on hosted runners fails container initialization.

How to fix it

Use supported container keys instead of options

Prefer the dedicated container keys for env, ports, and volumes rather than raw docker flags.

.github/workflows/ci.yml
jobs:
  test:
    runs-on: ubuntu-latest
    container:
      image: node:20
      env:
        NODE_ENV: test
      ports:
        - 6379:6379
      volumes:
        - my_data:/data
      options: --cpus 2

Avoid flags Actions already manages

  1. Do not set --entrypoint; Actions needs to inject its own to run steps.
  2. Use the env, ports, and volumes keys instead of -e, -p, -v in options.
  3. Limit options to resource flags like --cpus or --shm-size that do not conflict.

How to prevent it

  • Configure container env, ports, and volumes with their dedicated keys.
  • Reserve options for non-conflicting resource flags.
  • Never override the container entrypoint for a job container.

Related guides

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