build step instead of copying that config into every pipeline.
Depending on the module, a build produces a container image (pushed to ECR), a directory of static assets (uploaded to S3), or a Lambda zip package (uploaded to S3).
Builds only run through pipelines. There is no standalone build command or dashboard button.
You either add a
build step to a Ravion pipeline, or build in an external CI
system and hand Ravion the finished artifact at deploy time.Build config is part of the module config
You configure a module’s build the same way you configure everything else about it: through the module instance’s inputs, alongside its runtime config. There is no separate build file. For example, theweb-app module in a project config file sets its build inputs next to its port and health check:
Running a build
Add abuild step to your pipeline and point it at the module instance:
module_instanceaccepts a unique ID (mi_…),environment.module, orproject.environment.module.inputpasses build-time values the module accepts, such as a tag, branch, or commit. Check the module’s docs or schema (ravion module schema <module-type>) for what it takes.
Building something that isn’t a module? Use the standalone
build:image or build:static CI
steps, which take the full build config inline.Build infrastructure
New instances of the latest standard library modules default to Sandbox builds: Firecracker microVMs with 14 vCPUs, 28 GiB memory and 30 GiB disk. The first build creates the host pool automatically. You don’t need to choose EC2 machine types. Before your first sandbox build, update your AWS permissions. Use sandboxes unless your build needs a custom AMI or direct access to a dedicated EC2 instance. For those requirements, change Builder capacity type to EC2 or EC2 spot. The build uses the module’s Terraform execution environment unless you set Builder execution environment. In Builder config, you can adjust Builder vCPUs, Builder memory (GiB) and Builder disk (GiB). Existing module instances keep their saved builder settings when upgraded. To move an existing EC2 build to a sandbox, open Builder config, set Builder capacity type to Sandbox, and choose its CPU and memory. Older module versions may still label this option Sandbox (preview). Sandbox builds usedisk_cache: auto to keep dependencies, build output and Docker layers between successful runs. Interruptible build is on by default, allowing spot hosts and a restart from the beginning if the host is lost. Turn it off if your build changes external state, such as running database migrations.
See Sandboxes for pool settings, disk cache and cold-start behavior.
Docker layer cache
Sandbox module builds keep Docker’s build cache on the sandbox disk. Withdisk_cache: auto, Ravion saves the disk after a successful run and restores it for later runs. Dependencies, build output and Docker layers remain available without configuring a separate cache. See Disk cache for branch restore rules.
Disk caching also benefits static asset and Lambda builds.
To get the most out of the cache:
- Order your
Dockerfilefrom least- to most-frequently-changed. Copy manifest files (package.json,go.mod,requirements.txt) and install dependencies before copying the rest of the source. That way a source change doesn’t invalidate the dependency layer. - Pin base images by digest (or a specific tag) so the base layer is stable across builds.
build:image builds also use layer cache from ECR, alongside the local disk cache. Ravion imports cache from an image in the destination repository and its dedicated buildcache tag. This can help when a saved disk has no matching layers. On sandboxes, Ravion exports registry cache when a build pushes a new image digest, rather than on every unchanged build.
Choosing the cache source yourself
You don’t need to choose a registry cache source for sandbox disk caching. For image builds that import ECR cache, module definitions select that source for you. To choose it yourself, use a standalonebuild:image step and set cache_from on its builder block:
This example uses ci-builders as an execution environment given ID; replace it with yours.
tag and digest are optional, accept template tokens, and resolve against the step’s first ECR destination — so the tag or digest you name has to exist in that repo. digest wins if you set both. Omit cache_from entirely and the step falls back to the most recent image in that repo. See CacheFromConfig for the full field list.
Inspecting builds
A build is a pipeline step execution — there’s no separate build entity or command. Find it in the pipeline run:Feeding the artifact to a deploy
Every build step outputsbuild_ref — the canonical reference to the artifact it produced:
Pass it to the deploy step:
image_uri, image_digest, s3_bucket, s3_directory, s3_key, and more.
Building outside Ravion
You don’t have to build in Ravion at all. Module definitions typically include a prebuilt image or package option for teams that build in GitHub Actions, CircleCI, or another external system. For example,rvn-ecs-web supports these build_source values:
So with an external build, the flow is: your CI builds and pushes the image, then triggers the release with the artifact reference:
For module authors
How a definition declares its build config — builders (dockerfile, railpack), destinations, build inputs, and templating — is covered in the module definition schema.