Docker images
DevLyft runs the container image you point a build at. This page covers how to reference it and what the image needs to do to run well.
Referencing your image#
A build takes the image in two fields, Image and Tag. Put the repository in Image and only the tag in Tag. The Builds page then shows them joined as image:tag.
| Registry | Image | Tag |
|---|---|---|
| Docker Hub official image | nginx | 1.27 |
| Docker Hub user or org | acme/api | 1.4.2 |
| GitHub Container Registry | ghcr.io/acme/api | 1.4.2 |
| Any other registry | registry.example.com/team/api | 2026-09-30.1 |
Tag defaults to latest, but pin a real version instead. A fixed tag makes each build a precise record of what's running, so rolling back means pointing a deploy at an older build and saving it.
docker build -t ghcr.io/acme/api:1.4.2 .
docker push ghcr.io/acme/api:1.4.2
# New build → Image: ghcr.io/acme/api Tag: 1.4.2
Private registries#
Builds have no credential field, because the pull credential belongs to the deploy. Save the login once for the environment, then attach it to the deploys that need it.
- On the Secrets page, pick the project and environment, choose Registry credential, and enter a name such as
ghcr-prod, the registry host (for exampleghcr.io), a username, and a password or access token. Names use lowercase letters, digits and dashes, up to 32 characters. - On the Deployments page, create the deploy and pick the saved credential under Private registry login. DevLyft uses it to pull the image from the first pod on.
For a deploy that already exists, choose the credential in Edit, or open the deploy's row menu, choose Private registry, pick the saved credential and select Use.
Every deploy in the environment can use the same saved credential, so rotating a token is one change: save under the same name, or use Replace on the Secrets page, and every deploy using it picks up the new password. A saved credential stays until you delete it from the Secrets page, and DevLyft refuses to delete one while a deploy still uses it. Saving credentials needs the manager role, like other secrets. Any member can attach one to a deploy.
To stop a deploy using a credential, choose None (public image) under Private registry login when you edit it, or choose Stop using a credential on this deploy in the Private registry dialog. The credential stays saved for other deploys.
Architecture#
Builds have no architecture field. Nodes report their architecture in the Arch column on the Nodes page, and machine type ids name one too (devlyft-amd-…, devlyft-arm-…). The image must be able to run on the nodes it lands on. A multi-architecture image (built with docker buildx build --platform linux/amd64,linux/arm64) covers both.
What the image should do#
- Listen on one known port. Set it as the build's Container port. Without it, a deploy of the build can't be publicly exposed.
- Listen on all interfaces (
0.0.0.0), not just127.0.0.1, so traffic from the edge reaches the container. - Read configuration from environment variables. Plain variables and secrets both reach the container as environment variables. See Environment variables and secrets.
- Log to stdout and stderr. Watch logs shows what the container writes there. JSON lines with a
levelandmessagefield get level colouring and expandable fields. - Stay within its memory request. A workload that runs out of memory may restart. Watch the Restarts metric.
- Run more than one copy safely. A deploy can run several replicas, so keep state in a database or external store rather than on the container's filesystem.
Minimal example#
FROM node:22-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci --omit=dev
COPY . .
ENV PORT=8080
EXPOSE 8080
CMD ["node", "server.js"]
Create the build with Container port 8080. EXPOSE in the Dockerfile is documentation only. DevLyft uses the port set on the build.