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.
jobs:
test:
container:
image: node:20
options: --network host --entrypoint /bin/sh # --entrypoint conflicts with Actions
runs-on: ubuntu-latestCommon 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.
jobs:
test:
runs-on: ubuntu-latest
container:
image: node:20
env:
NODE_ENV: test
ports:
- 6379:6379
volumes:
- my_data:/data
options: --cpus 2Avoid flags Actions already manages
- Do not set --entrypoint; Actions needs to inject its own to run steps.
- Use the env, ports, and volumes keys instead of -e, -p, -v in options.
- 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.