> ## Documentation Index
> Fetch the complete documentation index at: https://docs.reactor.inc/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Reactor hosts multiple models, each with its own connect slug (modelName) and command/event schema. The catalog of every model — slug, typed SDK package, and links to its schema — is at /model-api-reference/overview. Some models expose one slug per experience (e.g. HappyOyster); always take the slug from the model's own pages, never guess it.
> Fastest path to a working app: `npx create-reactor-app my-app --model=<slug>` scaffolds a complete app with secure auth wired up. Typed TypeScript SDKs are published as @reactor-models/<model>; Python uses the base reactor-sdk package.
> Auth: exchange an API key (rk_...) for a JWT via POST https://api.reactor.inc/tokens from your server. Never put the API key in client-side code.
> Append .md to any docs URL for clean Markdown. Search these docs via the MCP server at https://docs.reactor.inc/mcp.

# reactor build

> Build the workspace's model container locally

```sh theme={"theme":{"light":"github-light","dark":"github-dark-high-contrast"}}
reactor build [flags]
```

## Description

Build the model defined by the current workspace.

The image is built from reactor.yaml's 'build:' block: the Dockerfile is
generated in memory and handed straight to BuildKit, never written to the
workspace. reactor.yaml must declare build.runtime\_version, which names
the reactor-runtime release the image installs.

A Dockerfile on disk takes the build over. The workspace ./Dockerfile is
built verbatim when it exists, and `-f`/`--dockerfile` builds an explicit path
instead; either way reactor.yaml's build fields are ignored, with a stderr
note naming them. `--no-dockerfile` builds from reactor.yaml even when a
./Dockerfile exists, and is mutually exclusive with `-f`/`--dockerfile`.

The result is tagged 'reactor-local/\<name>:dev' (where \<name> is
derived from the workspace directory name and sanitized for Docker).
'reactor run' resolves the same tag, so a successful 'reactor build'
followed by 'reactor run' boots the freshly built image.

`--build-secret` forwards a BuildKit secret using docker's standard
'`--secret`' grammar: comma-separated key=value fields with keys
type (file|env), id, src/source, and env - for example
'id=\<id>,src=\<path>', 'id=\<id>,env=\<envvar>', or 'type=env,id=\<id>'.
The secret is mounted at /run/secrets/\<id> only during a matching
'RUN `--mount`=type=secret,id=\<id>' step in the Dockerfile and is never
baked into image layers (unlike `--build-arg`, which is). Repeatable.

**Examples:**

```sh theme={"theme":{"light":"github-light","dark":"github-dark-high-contrast"}}
reactor build                                    # from reactor.yaml, layer cache on
reactor build -f Dockerfile.gpu                  # build a non-default Dockerfile
reactor build --no-dockerfile                    # ignore the on-disk ./Dockerfile
reactor build --no-cache                         # rebuild from scratch (no layer cache)
reactor build --build-secret id=github_token,env=GITHUB_TOKEN
```

## Options

| Flag                         | Description                                                                                                                                                          |
| ---------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--build-secret stringArray` | BuildKit secret forwarded to 'docker build `--secret`' (repeatable; e.g. id=github\_token,env=GITHUB\_TOKEN)                                                         |
| `-f, --dockerfile string`    | Path to an explicit Dockerfile (relative to the workspace); defaults to the workspace ./Dockerfile when one exists                                                   |
| `--no-cache`                 | Pass `--no-cache` to docker build (rebuild every layer)                                                                                                              |
| `--no-dockerfile`            | Build from reactor.yaml, ignoring an on-disk Dockerfile                                                                                                              |
| `--platform string`          | Target build platform (default linux/amd64). Overrides build.platform in reactor.yaml; an explicit 'FROM `--platform`=' in the Dockerfile still wins for that stage. |

## Global options

| Flag              | Description                                                                           |
| ----------------- | ------------------------------------------------------------------------------------- |
| `--server string` | Reactor API server URL (default "[https://api.reactor.inc](https://api.reactor.inc)") |
| `-v, --verbose`   | Enable verbose output                                                                 |

## See also

* [reactor](/deploy/cli-reference/reactor) - The CLI for the Reactor platform
