reactor build builds your workspace’s container image on the local Docker daemon:
reactor-local/<name>:dev, where <name> is the name of the directory you run
the command from (normally the workspace root), sanitized for Docker. reactor run derives the tag
the same way, so reactor build && reactor run always boots the image you just built.
The build block
Thebuild: block of reactor.yaml is the whole build. A minimal block is one line:
reactor.yaml
runtime_version pins the reactor-runtime release the image installs. Bump it to upgrade;
releases are immutable, so there is no latest to track. The build resolves the runtime and the
dependency file in a single pass, so a version conflict fails the build instead of surfacing when
the model loads. Add fields as the model needs them:
reactor.yaml
python_requirements carries the model’s own dependencies; the runtime version lives only in
runtime_version, so the two cannot drift.
Where build fits in the deployment flow
Publish runs the same image build internally, so you can go straight from register to publish.reactor build is still worth running first, as a pre-flight check: it
surfaces a broken build in seconds, on your machine, without touching the server. Follow it with
reactor run to confirm the image boots. The quick iteration loop is
built on exactly this pair.
Flags
Build secrets
Some builds need a credential mid-build, such as a GitHub token for a private repository, or an index URL for a private PyPI mirror. Pass it as a BuildKit secret rather than writing it intoreactor.yaml, where it would end up in version control, or into the image, where it would ship
with the release:
run step opts into the secret by mounting it, and reads it from the mounted path:
reactor.yaml
--build-secret uses docker’s standard --secret grammar (comma-separated key=value fields) and
is repeatable for multiple secrets:
The secret is visible at
/run/secrets/<id> only to the step that mounts it, and it never lands in
an image layer.
Publish with a build secret
reactor model publish takes the same --build-secret flag and passes it to its internal build.
When a run step mounts the secret, pass the flag:
--source, publish ignores it because that image is
already built. Everything else about publish is unchanged: it still registers the release tag,
pushes the image, and uploads weights when you pass --weights. See
Publish a release.
Hand-edited Dockerfile
Editing thebuild: block covers most models. When you need to shape the image itself, such as a
custom base layout or a multi-stage build, you can hand-edit a Dockerfile instead. Run reactor init
with --dockerfile to write the generated Dockerfile into the workspace as a starting point, and edit
it from there:
build: fields, naming the ones it dropped in a note on stderr. Pass --no-dockerfile to build
from reactor.yaml anyway.
ARG default values in a hand-edited Dockerfile apply as written, but the CLI has no
--build-arg to override them at build time. Use --build-secret for credentials and
build.runtime_env / build.build_env in reactor.yaml for values the generated build consumes.Good to know
- Docker must be running. The build talks to the local Docker daemon (honouring
DOCKER_HOST). When the daemon is unreachable the command fails with adocker daemon unreachableerror. Install or start Docker Desktop or Docker Engine. reactor rundoes not rebuild on changes. It auto-builds only when thereactor-local/<name>:devtag is missing entirely. After you editrequirements.txtor thebuild:block inreactor.yaml(or a hand-edited Dockerfile), runreactor buildagain. Otherwise an old image with the previous contents keeps running.- Build uses the directory you run it in. Unlike publish and deploy, build does not walk up to
the nearest
reactor.yaml: the build context, the-fpath, and the image tag all come from the current directory, so run it from the workspace root. Two directories with the same basename (say,~/work/my-modeland~/scratch/my-model) share thereactor-local/my-model:devtag and overwrite each other’s builds. .dockerignoreis honoured. The scaffolded.dockerignorekeeps paths such as.venv/andcheckpoints/out of the build context, which keeps the build fast and the image lean. With-f, a Dockerfile-specific ignore file next to it (for exampleDockerfile.gpu.dockerignore) fully replaces that file for the build.- Images target
linux/amd64, the platform Reactor’s production nodes run, so builds on Apple Silicon run under emulation and take noticeably longer. Most specific source wins: the--platformflag, thenbuild.platforminreactor.yaml, then that default. With a hand-edited Dockerfile, an explicitFROM --platform=in it wins for its own stage.
Next
Publish a release
Build the image, push it, and upload weights for a release.
Quick iteration
The edit, build, run loop for everyday development.