Starting points
- AWS
- Google Cloud
- Azure
- Terraform
- Kubernetes
deploy/aws.Dockerfile
Rules of the container
- The repository is mounted at
/workspace, which is also the working directory. SetWORKDIR /workspaceso relative paths in steps behave. - Steps run with
/bin/sh. Alpine’sshis BusyBoxash; installbashif your scripts need it and put#!/usr/bin/env bashat the top. - Reset the entrypoint of images that ship with the CLI as
ENTRYPOINT. Keel starts the container with its own command; an entrypoint that wraps every command inawsbreaks that. - Disable interactive prompts —
CLOUDSDK_CORE_DISABLE_PROMPTS=1,AWS_PAGER="",DEBIAN_FRONTEND=noninteractive. There is nobody at the keyboard. - There is no Docker daemon inside the container. A step cannot
docker buildordocker push. Use the cloud’s remote builder (Cloud Build, CodeBuild, ACR Tasks, Kaniko in a cluster) or build images in CI and have the deployment reference a tag — pass it as a deploy-time variable. Remote builders may default to the legacy Docker builder: a Dockerfile usingFROM --platform=$BUILDPLATFORM,TARGETOS/TARGETARCH,RUN --mount, or heredocs needs BuildKit. On Cloud Build, addenv: [DOCKER_BUILDKIT=1]to thegcr.io/cloud-builders/dockerstep; without it the build fails withfailed to parse platform : "" is an invalid component. - The container is disposable. Nothing written outside
/workspacesurvives the run. Nothing written inside/workspaceis committed anywhere; in Keel Cloud the clone is deleted, in Keel Dev it is your working tree.
Build context and caching
COPY can see. Most environment images copy nothing
from the repository, so a narrow context (deploy) keeps builds fast and
avoids invalidating layers when application code changes. When you use the
repository root, add a .dockerignore that excludes .git, node_modules,
build output, and .keel.
Keel tags the image per deployment — keel/dev-<deployment> in Keel Dev,
keel/cloud-<repo>-<deployment> in Keel Cloud — so Docker’s layer cache
carries across runs. A Dockerfile that has not changed rebuilds in seconds.
Order instructions from least to most frequently changing, as usual.