Docker Build Backend
The Docker backend builds container images from a Dockerfile using docker build, docker buildx, or buildctl.
See Building Images for the backend comparison and general options (build args, platform, cache).
Basic Usage
Section titled “Basic Usage”rise build myapp:latest --backend dockerrise deploy --backend docker:buildxIf no --backend is specified and a Dockerfile or Containerfile is present, Rise uses docker:buildx automatically (or docker:build if buildx is unavailable).
Backend Variants
Section titled “Backend Variants”docker/docker:build— runsdocker build. Simple and compatible, but no BuildKit features (no SSL cert injection, no secrets).docker:buildx— runsdocker buildx buildvia a BuildKit daemon. Supports SSL certificate injection, build secrets, and multi-platform builds. Recommended overdocker:build.docker:buildctl/buildctl— runsbuildctl builddirectly. Useful when Docker is not available but a BuildKit daemon is.
How It Works
Section titled “How It Works”docker:build: Runsdocker buildwith--build-argfor environment variables and--platformfor the target architecture. Does not support SSL certificate injection.docker:buildx: Runsdocker buildx buildvia a managed BuildKit daemon. SSL certificates are injected by preprocessing the Dockerfile to add BuildKit bind mounts to eachRUNstep.buildctl: Builds via buildctl. Images are output as a tar archive piped throughdocker loadfor local use, or pushed directly to the registry when deploying.
Custom Dockerfile Path
Section titled “Custom Dockerfile Path”rise build myapp:latest --dockerfile Dockerfile.prodOr in rise.toml:
[build]backend = "docker"dockerfile = "Dockerfile.prod"Build Contexts (Multi-Stage Builds)
Section titled “Build Contexts (Multi-Stage Builds)”Use additional directories as named build contexts:
rise build myapp:latest \ --build-context mylib=../my-library \ --build-context tools=../build-toolsOr in rise.toml:
[build]backend = "docker"build_context = "./app"
[build.build_contexts]mylib = "../my-library"tools = "../build-tools"Reference named contexts in your Dockerfile:
COPY --from=mylib /src /app/libPaths are relative to the rise.toml location. Build contexts work with all Docker-based backends.
SSL and Proxy
Section titled “SSL and Proxy”For corporate proxy or custom CA certificate setups, see SSL & Proxy Configuration. The docker:buildx and buildctl backends support full SSL certificate injection via the managed BuildKit daemon; docker:build does not.