GitHub Actions container job "workdir not found"
A container job passed a --workdir via container.options that the image filesystem does not contain. Docker refuses to start the container with a working directory that does not exist.
What this error means
The "Initialize containers" phase fails referencing a workdir path that is absent from the image.
github-actions
##[error]failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: chdir to cwd ("/app/build") set in config.json failed: no such file or directoryCommon causes
options --workdir points at a missing path
container.options included "--workdir /app/build" but the image never creates /app/build, so the container cannot chdir into it.
Confusing container workdir with the workspace
The runner mounts the repo at GITHUB_WORKSPACE automatically; overriding --workdir to a nonexistent path breaks that default.
How to fix it
Drop the override or point at an existing dir
- Remove the --workdir option and let the runner use the default workspace mount.
- If you need a custom workdir, choose a path that exists in the image (or create it via working-directory on the step).
- Re-run.
.github/workflows/ci.yml
jobs:
build:
runs-on: ubuntu-latest
container:
image: node:20-bookworm
steps:
- uses: actions/checkout@v4
- run: npm ci
working-directory: .How to prevent it
- Avoid overriding --workdir unless the image guarantees the path exists.
- Use step-level working-directory for per-step paths instead of container options.
Related guides
GitHub Actions "Invalid options for container"Fix the GitHub Actions error where container.options contains a flag the runner rejects, such as a reserved o…
GitHub Actions "working-directory ... does not exist"Fix the GitHub Actions error where a step fails because its working-directory path does not exist on the runn…
GitHub Actions container job "HOME is not set"Fix the GitHub Actions error where tools fail inside a container job because the HOME environment variable is…