You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(docker): add official CLI image and GHCR publish workflow (#3654)
* feat(docker): add official CLI image and GHCR publish workflow
Ship a minimal Node 22 Alpine image so projects on older Node LTS
versions can run Orval at build time without upgrading Node. Includes
multi-arch GHCR publishing on release tags and installation docs for
Windows, macOS, and Linux including localhost via host.docker.internal.
Co-authored-by: Cursor <cursoragent@cursor.com>
* chore(docker): harden image and refine publish workflow docs
Run the CLI image as a non-root user, disable checkout credential
persistence in the publish workflow, and align README Windows examples
with installation docs.
Co-authored-by: Cursor <cursoragent@cursor.com>
---------
Co-authored-by: Kuldeep Gehlot <kuldeep.gehlot@capsitech.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Replace `ghcr.io/orval-labs/orval` with `orval:local` when testing locally before the official image is published. See the [installation docs](https://orval.dev/docs/installation#docker) for details.
105
+
61
106
## A note about AI
62
107
63
108
First of all, we do not reject the use of AI agents outright. That said, please do not submit AI-generated output in a PR without reviewing it yourself. Every change must have a clear intent and purpose — do not submit changes you cannot explain in your own words. Making the effort to understand orval's codebase, TypeScript, and API clients beforehand, and reviewing what AI produces, is the contributor's responsibility, not the reviewer's. Finally, we will continue to welcome new contributors and actively support you through review and iteration.
Copy file name to clipboardExpand all lines: docs/content/docs/installation.mdx
+133Lines changed: 133 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,6 +30,139 @@ pnpm add orval -D
30
30
</Tab>
31
31
</Tabs>
32
32
33
+
## Docker
34
+
35
+
Orval 8+ requires Node.js 22.18 or newer. If your project targets an older Node LTS version, you can run code generation with the official Docker image instead of installing Orval locally.
36
+
37
+
`/app` is only a path inside the container. Your project does not need an `app` folder — mount your project root to any container path and set `-w` to match.
docker run --rm -v "%cd%:/app" -w /app ghcr.io/orval-labs/orval --config ./orval.config.ts
86
+
```
87
+
</Tab>
88
+
<Tabvalue="Windows (PowerShell)">
89
+
```powershell
90
+
docker run --rm -v "${PWD}:/app" -w /app ghcr.io/orval-labs/orval --config ./orval.config.ts
91
+
```
92
+
</Tab>
93
+
</Tabs>
94
+
95
+
On Windows Git Bash, prefix commands with `MSYS_NO_PATHCONV=1` so Docker receives `/app` instead of `C:/Program Files/Git/app`.
96
+
97
+
### Fetching OpenAPI from localhost
98
+
99
+
Inside a container, `localhost` refers to the container itself, not your machine. If your `orval.config.ts` fetches a spec from a local API (for example `https://localhost:7142/swagger/v1/swagger.json`), replace `localhost` with `host.docker.internal` and pass the URL via an environment variable.
100
+
101
+
| Host OS | Use instead of `localhost`|
102
+
| --- | --- |
103
+
| Windows / macOS (Docker Desktop) |`host.docker.internal`|
104
+
| Linux (Docker Desktop) |`host.docker.internal`|
105
+
| Linux (native Docker) |`host.docker.internal` with `--add-host=host.docker.internal:host-gateway`|
106
+
107
+
Read the URL from an environment variable in your config:
Set `NODE_TLS_REJECT_UNAUTHORIZED=0` only when your local API uses a self-signed certificate. For CI or offline builds, point Orval at a committed file such as `./src/swagger.json` instead.
115
+
116
+
Replace `ghcr.io/orval-labs/orval` with `orval:local` when testing with a locally built image before the official image is published.
0 commit comments