Deploy your applicationCreate a build

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.

YouPush an imageghcr.io/acme/api:1.4.2
→
BuildsCreate a buildImage, tag, port, CPU, memory
→
DeploymentsDeploy itEnvironment, location, replicas

Before 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#

  1. Open the New build form

    BuildsNew build. On an empty Builds page the button reads Create your first build.

  2. 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.

  3. 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.

    Example
    Image   ghcr.io/acme/api
    Tag     1.4.2
  4. Set 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.

  5. Set CPU and memory

    Use the CPU and Memory steppers, or click a value to type an exact amount. The defaults are 0.5 CPU and 512 MB. See CPU and memory below.

  6. 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:tag in the deploy form and the Deployments table.
Image
Registry and repository, for example nginx, docker.io/library/nginx or ghcr.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.
CPU
CPU request per replica, in cores. 0.125 to 4 on the Builds page.
Memory
Memory request per replica. 256 MB to 8 GB on 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.”
Stored on the build
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:

API
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 DeploymentsNew 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.