Build servers
A build pool builds your images away from the servers that run them. Reoclo pushes each image to your registry, and your servers only pull it by digest. Point an application or a stack at a pool in its build settings.
Create pools under Build servers in the dashboard. Each pool has one of three builder types. To run tests on machines Reoclo creates in your account, see Test servers.
| Type | What runs your builds | Providers |
|---|---|---|
| Always-on | Servers you registered with the Build or Both role. They run all the time. | Any server |
| Ephemeral | A builder Reoclo creates for a build and deletes afterwards. | Hetzner, AWS |
| Sleep | A builder Reoclo creates once, stops when it is idle, and starts again for the next build. | AWS |
Builders Reoclo creates live in your own cloud account, through the cloud credential you choose for the pool. Reoclo never creates servers in an account of its own. To set up an account, see AWS setup or Hetzner setup below.
Always-on pools
Section titled “Always-on pools”An always-on pool builds on servers you already run.
- Open the server’s Settings and set Role to Build (builds only) or Both (builds and runs applications).
- Create an Always-on pool and select up to 50 of those servers. A server belongs to one pool at a time.
- Set Concurrent builds per server, from 1 to 16. The default is 1.
Ephemeral pools
Section titled “Ephemeral pools”On Hetzner, a builder is billed for every hour it has started, so an idle builder stays warm until minute 55 of that hour and takes queued builds in the meantime. Then it is deleted before the next hour starts. Choose As soon as idle or After a set idle time to delete it sooner.
On AWS, a builder is billed per second, so it is deleted as soon as it is idle by default. Choose After a set idle time to keep it for the next few builds.
Every ephemeral builder is deleted at its maximum lifetime, even while busy. The default is 120 minutes.
Sleep pools
Section titled “Sleep pools”A sleep pool keeps its builders between builds. When a builder has been idle for the pool’s idle time (15 minutes by default), Reoclo stops it. The next build starts it again, which usually takes under a minute, and the builder still has the Docker layers of its earlier builds on its volume.
While a builder is stopped, AWS bills only its volume. Compute and its public IPv4 address stop billing until it starts again.
Each build on a sleep builder shows its share of the builder’s cost. When the builder stops, the time it was awake is split across the builds it ran in that session, in proportion to how long each one built.
The maximum lifetime caps one running session. Past it, the builder is stopped, not deleted. A builder that does not reconnect within 10 minutes of a start is deleted, and the next build creates a fresh one.
A sleep builder is replaced once it reaches the pool’s maximum builder age, 7 days by default. Reoclo deletes a stopped builder of that age, and the next build creates a fresh one with a clean volume and the current image. A builder is never retired while it is awake, so one that reaches the age during a build is retired the next time it stops.
A stopped builder cannot update or repair its runner on its own. Update runner and Repair runner on a stopped sleep builder, and the runner upgrade policy, wake it, do the work, and stop it again right away unless builds are waiting for it. Builds that arrive in the meantime wait in the queue, usually a minute or two, and a runner restart never reaches a running build. If the builder is busy, the work starts when its current build finishes. Reoclo gives the work 25 minutes; after that it gives up, records why, and stops the builder. The builder’s page shows what it is doing, such as “Waking to update the runner”, and how the last run ended.
The wake counts against the pool’s monthly budget like any other start. When the budget is used up, the builder stays asleep and the request says so.
When a builder wakes for a build with an older runner than the current release, Reoclo also updates the runner first and keeps the builder out of the pool until it reconnects. If the update fails or takes more than 4 minutes, the builder takes builds with the runner it has.
Sleep is not offered on Hetzner. Hetzner bills a stopped server at the full rate until it is deleted, so stopping it saves nothing. Use an ephemeral pool there.
Pool settings
Section titled “Pool settings”Ephemeral and sleep pools share these settings. While a pool has live builders, only the idle policy, lifetime and maximum builder age can change. The rest unlock once every builder is deleted.
| Setting | What it does |
|---|---|
| Credential | The Hetzner or AWS credential builders are created with. It must belong to your organization. You can switch it once the pool has no builders, see Switch a pool’s credential. |
| Location or Region | Where builders run. On Hetzner you pick a location, such as fsn1. On AWS you pick one of the credential’s regions. |
| Server type or Instance type | The builder size, such as cx33 on Hetzner or m7i.large on AWS. |
| Fallback types | Tried in order when the provider has no capacity for the main type. |
| Architecture | amd64 or arm64. Images build natively, so every type must match it. |
| Snapshot image or AMI | Optional. Builders use Ubuntu 24.04 when it is empty. |
| Max builders | How many builders the pool runs at once, from 1 to 50. |
| Build cache | Registry cache pushes the layer cache to your registry under a buildcache tag, so a fresh ephemeral builder reuses earlier layers. Sleep builders keep their layers on the volume. |
| Root volume | AWS only. gp3 storage from 20 to 500 GB, 50 GB by default. It keeps billing while a sleep builder is stopped. |
| Remove idle builders or Stop idle builders | When an idle builder is deleted (ephemeral) or stopped (sleep). |
| Max lifetime | From 5 to 1,440 minutes, 120 by default. |
| Max builder age | Sleep pools only. From 1 to 30 days, 7 by default. A stopped builder this old is deleted, and the next build creates a fresh one. |
Move applications and stacks off a pool
Section titled “Move applications and stacks off a pool”A pool cannot be deleted while applications or stacks still build on it. Click Delete on the pool and the dialog lists them by name, with a count for each.
- Under Move them to, pick another pool or Build on the deploy server.
- Click Move and delete pool.
Reoclo checks every application and stack against the destination before it moves any of them. If one cannot move, for example because it has no pull-only registry credential, the message names it and nothing changes. A move to another pool keeps each item’s registry push target and credentials. A move to the deploy server clears the push target, and those builds run on the server that runs the application again.
The pool also stays in place while builds are queued or running on it. Wait for them to finish, or cancel them.
When you delete a pool that still has builders, they stop counting toward your costs at that moment and Reoclo still deletes them in your cloud account. A builder Reoclo cannot reach, for example because the credential’s keys no longer work, is not deleted for you. Reoclo closes its record and keeps its instance ID in the audit log; terminate that instance in the cloud console.
Switch a pool’s credential
Section titled “Switch a pool’s credential”An ephemeral or sleep pool can create its builders with a different credential, for example after the keys behind the old one were revoked. Open the pool, click Edit and choose another credential.
The new credential must be an active credential of your organization for the same provider. On AWS, the pool’s region must be one of the new credential’s regions. Add the region to the credential first, or move the pool to one of its regions in the same edit.
Reoclo refuses the switch while the pool has any builder that is not deleted. Those builders were created with the old keys, and only those keys can stop or delete them. Delete the builders, or forget the ones Reoclo can no longer reach, and then switch.
Forget a builder
Section titled “Forget a builder”When the keys behind a pool stop working, Reoclo cannot stop or delete the pool’s builders, and they stay in the list. Forgetting a builder removes it without contacting the cloud.
- Open the pool’s Builders list and click Forget next to the builder.
- Read the confirmation. It names the instance ID and the region.
- Confirm, then terminate that instance in the cloud console yourself.
Reoclo stops tracking the builder, records it as deleted with the reason forgotten, and takes its server out of the pool. The instance itself is not touched. It keeps running or stays stopped in your account, and keeps billing, until you terminate it.
You cannot forget a builder that is running a build. Wait for the build to finish or cancel it.
Build values and secrets
Section titled “Build values and secrets”A pool build runs on a builder that cannot read your application’s environment. Reoclo gives the build only what you mark for it, because a build argument’s value is stored in the image history and in the registry cache. Everything else stays out.
Mark a variable under Environment when you add or edit it. These options appear once build servers are enabled for your organization. A variable is one of the two, never both. From automation, use reoclo env set --public-build or --build-secret (CLI 0.110.0 or later, see reoclo env), or the MCP set_env_var tool with build_exposure set to public_build_value, build_secret or none. reoclo env ls shows each variable’s option in its BUILD column.
| Option | Reaches the build as | Use it for |
|---|---|---|
| Public build value | A literal build argument, read from your compose file with ${VAR} | Values that may ship in the image, such as NEXT_PUBLIC_ variables |
| Build secret | A BuildKit secret, never a build argument | Tokens the build needs but the image must not contain |
A build secret is available to the build only. It is never in the running container: Reoclo leaves it out of the container’s environment and out of the env files it writes for the container. The deploy log names the keys it held back, never the values: Build secrets kept out of the running container: NPM_TOKEN, SENTRY_AUTH_TOKEN.
When the build runs on your own server instead of a pool, a compose file can still read a build secret with ${VAR} while it builds. Reoclo gives that build a temporary env file and deletes it as soon as the build ends.
Public build values
Section titled “Public build values”In a compose file, a build argument can read a public build value with ${VAR}, ${VAR:-default}, ${VAR-default} or $VAR. Reoclo substitutes the value before the build starts and follows Compose rules:
${VAR:-default}uses the default when the value is unset or empty.${VAR-default}uses it only when the value is unset.- A plain
$VARor${VAR}that is unset becomes an empty string. $$is a literal dollar sign.- A value can mix text and several variables, such as
https://${HOST}/v${VERSION:-1}.
To use a value from a secret project as a public build value, add a variable that references the project’s key and mark it. The value stays in the project:
reoclo env set --app web --ref production-product-landing --public-build NEXT_PUBLIC_GA_MEASUREMENT_IDA build argument that reads a variable which is not a public build value is refused. This happens when you move an application or stack to a pool, and again at build time. The error names the argument, the service and the line of your compose file:
Pool builds cannot use build arg CONTENTFUL_ACCESS_TOKEN (service web, line 8): ${CONTENTFUL_ACCESS_TOKEN} is not a public build value. Mark it as a public build value if it may ship in the image, or pass it as a build secret.Pool builds also refuse build arguments with no value, ${VAR:?message} style checks, additional_contexts and dockerfile_inline.
Compose build secrets
Section titled “Compose build secrets”List the secrets a service needs under build.secrets, and define each one under the top-level secrets. Both the short form (- name) and the long form (source with an optional target) work. The id BuildKit sees is the target when you set one, otherwise the secret name.
A secret defined with environment: VAR reads VAR from the application’s environment, whether or not you marked it as a build secret. When the application has no variable named VAR, the build reads it from the application’s secret project bindings, and for a stack service from the stack’s bindings first, the same way the running container gets them. A project limited to certain servers is never sent to a builder: if VAR can only come from such a project, the build fails and the log names the project. A secret defined with file: is refused in pool builds, because the file is not on the builder.
Example: a Next.js app
Section titled “Example: a Next.js app”Add NEXT_PUBLIC_API_URL as a Public build value and CONTENTFUL_ACCESS_TOKEN as an environment variable, then read them in your build:
services: web: build: context: . args: NEXT_PUBLIC_API_URL: ${NEXT_PUBLIC_API_URL} secrets: - contentful_tokensecrets: contentful_token: environment: CONTENTFUL_ACCESS_TOKENARG NEXT_PUBLIC_API_URLRUN --mount=type=secret,id=contentful_token,env=CONTENTFUL_ACCESS_TOKEN npm run buildThe API URL ends up in the image, which is fine for a NEXT_PUBLIC_ value. The token is mounted for that one RUN step and is never written to the image.
Disk space
Section titled “Disk space”Builders that keep their Docker data between builds cap their build cache at about 40% of the disk, and each build removes the image tags it created. When a builder is nearly full, Reoclo clears old build cache and unused build images before the next build starts. If that still leaves too little room, the build fails and names the builder.
AWS setup
Section titled “AWS setup”AWS builders run in the region you pick for the pool, one of its credential’s regions, in that region’s default VPC. They get no SSH key and no inbound ports: the runner on the builder connects out to Reoclo.
- Build the IAM policy below. Add every region your pools will build in.
- Create an IAM user with the policy and an access key. Use the AWS CLI or Terraform tab to do it in one step, or follow the console steps in the AWS setup guide.
- In Reoclo, open Cloud providers, click Add Provider, choose Amazon Web Services, and add the same regions under Regions. The first is the default for new pools.
- Under Build servers, create an Ephemeral or Sleep pool and choose that credential.
One credential serves pools in all of its regions. To change the list, open the credential under Cloud providers and click Edit next to Regions. A region a pool still uses cannot be removed: move the pool to another region in its settings first, which you can do once it has no builders.
Reoclo prices AWS builders from AWS’s on-demand rates in every region it lists, including the volume and the public IPv4 address. Not every instance type is sold everywhere: c7a.large, for example, is mostly limited to US regions. Give the pool fallback types if you build in more than one region.
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "ReocloEC2Read",
"Effect": "Allow",
"Action": "ec2:Describe*",
"Resource": "*"
},
{
"Sid": "ReocloBuilderLaunchTagged",
"Effect": "Allow",
"Action": "ec2:RunInstances",
"Resource": [
"arn:aws:ec2:us-east-1:*:instance/*",
"arn:aws:ec2:us-east-1:*:volume/*"
],
"Condition": {
"StringEquals": {
"aws:RequestTag/reoclo-managed": "true"
}
}
},
{
"Sid": "ReocloBuilderLaunchResources",
"Effect": "Allow",
"Action": "ec2:RunInstances",
"Resource": [
"arn:aws:ec2:us-east-1::image/*",
"arn:aws:ec2:us-east-1:*:subnet/*",
"arn:aws:ec2:us-east-1:*:network-interface/*",
"arn:aws:ec2:us-east-1:*:security-group/*"
]
},
{
"Sid": "ReocloBuilderTagOnLaunch",
"Effect": "Allow",
"Action": "ec2:CreateTags",
"Resource": "arn:aws:ec2:us-east-1:*:*/*",
"Condition": {
"StringEquals": {
"ec2:CreateAction": "RunInstances"
}
}
},
{
"Sid": "ReocloBuilderLifecycle",
"Effect": "Allow",
"Action": [
"ec2:StartInstances",
"ec2:StopInstances",
"ec2:TerminateInstances"
],
"Resource": "arn:aws:ec2:us-east-1:*:instance/*",
"Condition": {
"StringEquals": {
"aws:ResourceTag/reoclo-managed": "true"
}
}
},
{
"Sid": "ReocloVerify",
"Effect": "Allow",
"Action": "sts:GetCallerIdentity",
"Resource": "*"
}
]
} Policy size: 1,127 of 6,144 characters.
Every instance and volume Reoclo creates carries the tag reoclo-managed=true, so the policy only lets the key start, stop and terminate those. Your other instances stay out of reach.
Builders use Canonical’s newest Ubuntu 24.04 image for the pool’s architecture unless you give the pool an AMI. They require IMDSv2. T-family instances launch with standard CPU credits, so a long build is throttled rather than billed for surplus credits.
Hetzner setup
Section titled “Hetzner setup”Hetzner API tokens have no fine-grained permissions. Generate a Read & Write token in the project your builders should run in, then add it under Cloud providers. The Hetzner setup guide has the steps.
Builders count toward the project’s server limit. Keeping them in a project of their own stops a busy pool from blocking new servers elsewhere, and keeps their cost separate on your Hetzner invoice.
Costs and budgets
Section titled “Costs and budgets”Organizations with cost management turned on see a Costs page under Settings. It is the one place for what an organization spends on machines Reoclo creates in its cloud accounts. Build servers and Test servers show only a one-line summary that links to it.
The page has three parts:
- Spend by provider. Month to date and the forecast for the month, one row per provider and currency. AWS bills in USD and Hetzner in EUR, and a Hetzner project can bill in USD too, so currencies are never added together. Each row splits into build machines, test machines and Reoclo-created servers. A price change notice appears only for a provider your organization uses.
- Budgets. Every build and test pool with a budget, listed together, worst first. Each pool shows its spend and forecast against its budget in the pool’s own currency. Spend of pools that no longer exist is gathered in one row, so the provider totals always add up.
- Server plan costs. The monthly plan price of each server.
Amounts are estimates, net of VAT. Hetzner estimates include the traffic and storage Reoclo can read. AWS estimates cover compute, the public IPv4 address and the volume, and leave out data transfer.
Pool budgets
Section titled “Pool budgets”Every ephemeral, sleep and test pool has a monthly budget. The budget is a spending cap, so it is always saved and shown, even when your organization does not see cost figures. A pool is near its limit at 80% and at its limit at 100%. At 80%, Reoclo sends the organization’s admins one notice for the month. At the limit, nothing running is stopped: new machines wait, and queued builds and jobs stay queued, until the next month starts or you raise the budget. A pool also waits when its history holds spend in a currency other than the budget’s, because Reoclo never converts currencies.
To change a budget, click Edit budget next to the pool on the Costs page, enter the new amount and click Save budget. You need permission to edit server settings. The amount is net, in the pool’s currency.
When a build waits
Section titled “When a build waits”A queued build waits instead of failing when the provider has no room for another builder:
- Hetzner server limit reached for this project. Delete a server or ask Hetzner to raise the limit.
- AWS instance or vCPU limit reached in the region. Ask AWS to raise the quota.
- No capacity for the server type in the location. Add fallback types to the pool.
- API rate limit reached. Reoclo slows down and retries on its own.
The deployment shows the reason while it waits, and the build starts once capacity appears. These waits do not time out, so cancel the deployment if you do not want to wait. A build that waits for any other reason fails after 30 minutes in the queue.
If a pool reaches its monthly budget, no new builder is created or started for it, and builds wait in the queue. Raise the budget on the Costs page, or wait for the next month.
Cap build memory on a server
Section titled “Cap build memory on a server”When an application builds on the server that runs it, a build that needs more memory than the server has can make the kernel stop Docker. Reoclo already refuses to start a build when the server is short of memory. To go further, cap how much memory the build itself can use.
Add this label to the server, under Labels on its page:
| Label | Value |
|---|---|
reoclo.build.max_memory_mb | Whole megabytes, 512 or more. For example 2048. |
Servers without the label build as they always have. With the label, builds of Dockerfile and Compose applications, and pull request previews, run in a separate BuildKit builder limited to that much memory, with no swap. Reoclo creates the builder on the server the first time it is needed and reuses it afterwards. Images still end up in the server’s local image store, so the deploy works as before. Changing the value creates a new builder and removes the old one.
The deploy log shows Building in a BuildKit builder capped at 2,048 MB (reoclo.build.max_memory_mb). when the cap is in effect.
- A build that needs more than the cap fails. The deployment reports that the build ran out of memory on the server and needed more than the limit. Raise the limit, or build the application on a build pool.
- A value Reoclo cannot use is ignored. Text, zero, and anything below 512 add a warning to the deploy log, and the build runs without a cap.
- A cap that cannot be applied fails the build. If the server has no
docker buildxplugin, or the builder cannot be created, the deployment fails and names the label and the reason. It never falls back to an uncapped build.
The cap limits the build, not the running container. Set the container’s own limit in the application’s resource limits.
Troubleshooting
Section titled “Troubleshooting”When a builder cannot be created, the build and the builder show an error code.
| Code | Cause and fix |
|---|---|
aws_default_vpc_required | The region has no default VPC. Create one with aws ec2 create-default-vpc --region <region>. |
aws_unauthorized | The key’s policy does not allow the call in this region. Rebuild the policy with the pool’s region included and replace the old one. |
builder_price_unavailable | Reoclo has no price for the instance type in this region, usually because AWS does not sell it there. Pick another type, or add fallback types. |
credential_invalid | AWS or Hetzner rejected the key. Check that it is active, then add the credential again. |
owned_active_builder_credential_required | The pool’s credential was revoked, failed verification, or belongs to the platform rather than your organization. |
not_found | The instance type, server type or image does not exist in this region or location. |