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 with the Buildx plugin enabled.
Required permissions
Required permissions
You need push permission on images. See Image Permissions.
Docker Buildx enabled
Docker Buildx enabled
Starting with CLI v3.7.2, If not installed, add the plugin:
cpln image build requires Docker Buildx.Verify Buildx is available:Push with the CLI
The simplest way to build and push images:- With Dockerfile
- With Buildpacks
Push with Docker
1
Authenticate Docker
Configure Docker to authenticate with your org’s registry:
2
Build the image
Build with the correct tag format:
3
Tag an existing image (optional)
If you have an existing image, tag it for your registry:
4
Push to registry
Image name format
Images must use this format to push to your registry:my-org.registry.cpln.io/api:v1.0.0my-org.registry.cpln.io/frontend:latestmy-org.registry.cpln.io/worker:abc123
CI/CD authentication
For CI/CD pipelines without the CLI, authenticate with a service account:| Parameter | Value |
|---|---|
| Registry | ORG_NAME.registry.cpln.io |
| Username | <token> (literal string) |
| Password | Service account key |
Use pushed images
Reference pushed images in workloads:Common workflows
Build and deploy
CI/CD pipeline
Troubleshooting
unknown shorthand flag: 'f' in -f
unknown shorthand flag: 'f' in -f
Docker Buildx is not installed. Install it:
Authentication failed or 403
Authentication failed or 403
Re-run
cpln image docker-login to refresh credentials and double check that you don’t have typos in the org name.Push denied
Push denied
Verify you have push permission on images. Check your policies or refresh your service account token.
Image too large
Image too large
Optimize your Dockerfile:
- Use multi-stage builds
- Start from smaller base images
- Remove unnecessary files