When to use this
CI/CD pipelines
Build and push images in automated pipelines
Local development
Push locally-built images for testing
Private registry
Store images in your org’s secure registry
No Dockerfile
Build automatically with buildpacks
Prerequisites
CLI installed
CLI installed
Install the Control Plane CLI. See Installation.
Docker installed
Docker installed
Install Docker. The Buildx plugin is recommended (used by default when available) but no longer required for single-platform builds.Docker is only needed for local builds;
cpln image build --remote builds remotely instead.Required permissions
Required permissions
You need push permission on images. See Image Permissions.
Docker Buildx (recommended)
Docker Buildx (recommended)
As of CLI v3.7.2, If not installed, add the plugin:
cpln image build uses docker buildx build. As of CLI v3.9.0, it falls back to legacy docker build when Buildx is unavailable, so Buildx is optional for single-platform builds. Multi-platform builds (comma-separated --platform values) still require Buildx.Verify Buildx is available:Build and push
- Using the CLI (Recommended)
- Using Docker directly
Best for: Local development, CI/CD pipelines, buildpack buildsOr specify a different path:See Build Arguments for the forms it accepts.The value is mounted for that step only, so it never lands in the image or its layers. See Build Secrets.Buildpacks detect your language and create an optimized image. See Buildpacks conventions for language-specific requirements.Or build a repository directly:See Remote builds for details.
- Authenticates to your org’s private registry automatically
- Simple naming (
--name my-app:v1) - Supports Dockerfile or Buildpacks
- Builds remotely without Docker (
--remote)
With a Dockerfile
The Dockerfile is automatically detected (defaults to./Dockerfile):With build arguments
Pass a value the Dockerfile reads withARG, either directly or from your environment:With a private registry or other build credential
A build that installs from a private package registry needs a credential during the build, but not in the finished image. Store it as a secret in your org and mount it for the step that needs it:With Buildpacks
Build automatically without a Dockerfile:Without Docker
Add--remote to build remotely; the image is pushed for you:Reference images in workloads
Once pushed, reference your images in workloads using the Control Plane image link format. Shorthand format (recommended):Common workflows
Build and deploy
CI/CD pipeline
Build with a stamped revision and a private registry credential
--push for --remote, where the build service resolves the secret itself.
Troubleshooting
For common issues with building and pushing images, see Images Troubleshooting.Next steps
Pull Images
Configure workloads to pull images
Copy Images
Copy images between organizations
Create a Workload
Deploy your pushed images
Image Reference
Image configuration details