Create a build
A build is a container image plus the resources it asks for: image, tag, the port it listens on, and a CPU and memory request per replica. Creating a build registers that configuration in a project; nothing runs until you deploy it.
What a build is#
DevLyft doesn't compile your source code. A build points at an image you have already built and pushed to a registry, and records how much CPU and memory each running copy should get. One build can be deployed to many environments, for example the same image in staging and then production.
ghcr.io/acme/api:1.4.2Before you start#
- A project. Builds belong to exactly one project.
- A container image in a registry DevLyft can pull from, and the tag you want to run. See Docker images.
- The port your application listens on, if it should receive traffic.
Create a build from an image#
Open the New build form
Builds→New build. On an empty Builds page the button reads Create your first build.
Choose the project and name the build
Pick the Project. You can't move a build to another project later. Give it a Name, such as
api: this is what the Build list shows when you deploy.Enter the image and tag
Image is the repository without the tag; Tag defaults to
latest. Prefer an immutable version tag so a deploy always runs the image you tested.ExampleImage ghcr.io/acme/api Tag 1.4.2Set the container port
Container port is the port your process listens on inside the container, 1–65535. It's optional, but a deploy can only be publicly exposed, and so only receive routes and a custom domain, if its build has one.
Declare game server ports (for fleets)
A game server listens on one or more ports, each with a protocol. Add them under Game server ports: a name, a protocol (
UDP,TCP,TCPUDP,HTTPorWEBSOCKET) and a port number from 1024 to 65535 (9357 and 9358 are reserved). Your server always listens on the number you declare here. AUDP,TCPorTCPUDPport gets its own port on the host for each game server, chosen when it starts and given back by the port's name when it is allocated. AnHTTPorWEBSOCKETport gets a URL on a host of that one game server instead, given back the same way. Your client finds each port by its name, so keep the names the same from one version of a build to the next: changing a number is fine, renaming or removing a port breaks every client that asks for it. A fleet that runs the build takes these as its own. A deploy ignores them and uses the container port. Skip this for a build that only deploys run.Set CPU and memory
Use the CPU and Memory steppers, or click a value to type an exact amount. The defaults are
0.5 CPUand512 MB. See CPU and memory below.Create the build
Choose Create build. The build appears at the top of the Builds list.
Field reference#
- Project
- The project the build belongs to. Fixed after creation.
- Name
- A label for the build, shown as
name:tagin the deploy form and the Deployments table. - Image
- Registry and repository, for example
nginx,docker.io/library/nginxorghcr.io/acme/api. - Tag
- The image tag to run. Defaults to
latest. - Container port
- Optional. The port your container listens on. Required to expose a deploy built from this build.
- Game server ports
- Optional. A name, a protocol and a port number each, up to 16, with no name or number repeated. A fleet that runs the build takes them; a fleet cannot run a build that declares none. Left out of an API update they are left as they are; an empty list clears them.
- CPU
- CPU request per replica, in cores.
0.125to4on the Builds page. - Memory
- Memory request per replica.
256 MBto8 GBon the Builds page, and 1–4 GB per CPU.
CPU and memory#
The CPU and memory on a build are the request for each replica. A deploy with three replicas uses three times the build's request, and shared compute is billed per second on exactly what you request. See CPU and memory for units and presets.
- The steppers move through common steps (0.125, 0.25, 0.5, 1, 2, 4 CPU; 256 MB up to 8 GB), always including the minimum and maximum. Click the value to type an exact amount.
- A build isn't tied to an environment, so the Builds page uses the shared instance rules: 0.125–4 CPU, 256 MB–8 GB, and 1–4 GB of memory per CPU. The form shows this as “Shared instances: 0.125–4 vCPU, 256 MB–8 GB, with 1–4 GB of memory per vCPU.” and won't create a build outside it. When the build runs on a dedicated machine, Adjust resources on the deploy caps it to what that machine can fit.
- Only Managers and Admins can change CPU and memory. For other roles the steppers are disabled with “Only managers and admins can change resources.”
cpu_request "0.5" # cores
memory_request "512Mi" # binary units: Mi, Gi
Private registries#
Architecture#
A build has no architecture setting. Nodes report their architecture on the Nodes page, and dedicated machine types are named by family.
Creating builds from GitHub Actions#
If your CI already pushes images, it can register each one as a build with an API key:
curl -X POST https://api.devlyft.io/v1/projects/$PROJECT_ID/builds \
-H "Authorization: Bearer $DEVLYFT_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name": "api", "image": "ghcr.io/acme/api", "tag": "'"$GIT_SHA"'",
"container_port": 8080, "cpu_request": "0.5", "memory_request": "512Mi"}'
What happens after creation#
- The build is listed on the Builds page with its image, CPU, memory, port, project and age.
- It becomes selectable in the Build list of Deployments→New deploy for any environment in the same project.
- Nothing runs and nothing is billed until you deploy it. The image is pulled when a deploy starts replicas.
Next: create an environment, then deploy the build.