Build Configuration
Configure Docker buildx builds in cyan.yaml
Build Configuration
The build: section in cyan.yaml configures Docker buildx builds for publishing artifacts to a container registry. This configuration is used by the cyanprint build command and the --build flag on cyanprint push.
The build: section is optional and only needed when you want to build and push Docker images. It's required when using cyanprint build or cyanprint push <artifact> --build <tag>.
Basic Structure
build:registry: ghcr.io/myorgplatforms:- linux/amd64images:template:image: my-templatedockerfile: docker/Dockerfile.templatecontext: .
Configuration Reference
Top-Level Fields
Prop
Type
Image Types (under images:)
Prop
Type
ImageConfig Fields
Each image type (template, blob, processor, plugin, resolver) accepts these fields:
Prop
Type
The image field is optional in the schema but required in practice for the build to work. Without it, the image cannot be properly tagged for the registry.
Full Image Path
Images are tagged using the pattern:
{registry}/{image}:{tag}
For example, with registry: ghcr.io/myorg and image: my-template, building with tag v1.0.0 produces:
ghcr.io/myorg/my-template:v1.0.0
Examples
Template with Blob
build:registry: ghcr.io/atomicloudplatforms:- linux/amd64images:template:image: my-templatedockerfile: cyan/Dockerfilecontext: ./cyanblob:image: my-template-blobdockerfile: blob.Dockerfilecontext: .
Multi-Platform Build
build:registry: ghcr.io/myorgplatforms:- linux/amd64- linux/arm64images:template:image: universal-templatedockerfile: Dockerfilecontext: .
Processor with Custom Dockerfile Location
build:registry: docker.io/myuserplatforms:- linux/amd64images:processor:image: my-processordockerfile: docker/Dockerfile.processorcontext: ./processor
All Artifact Types
build:registry: ghcr.io/myorgplatforms:- linux/amd64- linux/arm64images:template:image: my-templatedockerfile: docker/Dockerfile.templatecontext: .blob:image: my-blobdockerfile: docker/Dockerfile.blobcontext: ./blobprocessor:image: my-processordockerfile: docker/Dockerfile.processorcontext: ./processorplugin:image: my-plugindockerfile: docker/Dockerfile.plugincontext: ./pluginresolver:image: my-resolverdockerfile: docker/Dockerfile.resolvercontext: ./resolver
Usage
Building Images
Use the build command to build and push images:
cyanprint build v1.0.0
The command:
- Reads the
build:section fromcyan.yaml - Builds each defined image using Docker buildx
- Pushes images to the configured registry
Build with Push
Use push --build to build and publish in one step:
# Build and push a templatecyanprint push template --build v1.0.0 --token $CYAN_TOKEN# Build and push a processorcyanprint push processor --build v1.0.0 --token $CYAN_TOKEN# Build and push a plugincyanprint push plugin --build v1.0.0 --token $CYAN_TOKEN# Build and push a resolvercyanprint push resolver --build v1.0.0 --token $CYAN_TOKEN
Platform Override
Override configured platforms via CLI:
# Use CLI-specified platform instead of configcyanprint build v1.0.0 --platform linux/amd64
Platform Resolution
Platforms are resolved in this order:
- CLI
--platformoption (highest priority) build.platformsfrom config- Current platform (fallback)