LogoCyanPrint

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

cyan.yaml
build:
registry: ghcr.io/myorg
platforms:
- linux/amd64
images:
template:
image: my-template
dockerfile: docker/Dockerfile.template
context: .

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

cyan.yaml
build:
registry: ghcr.io/atomicloud
platforms:
- linux/amd64
images:
template:
image: my-template
dockerfile: cyan/Dockerfile
context: ./cyan
blob:
image: my-template-blob
dockerfile: blob.Dockerfile
context: .

Multi-Platform Build

cyan.yaml
build:
registry: ghcr.io/myorg
platforms:
- linux/amd64
- linux/arm64
images:
template:
image: universal-template
dockerfile: Dockerfile
context: .

Processor with Custom Dockerfile Location

cyan.yaml
build:
registry: docker.io/myuser
platforms:
- linux/amd64
images:
processor:
image: my-processor
dockerfile: docker/Dockerfile.processor
context: ./processor

All Artifact Types

cyan.yaml
build:
registry: ghcr.io/myorg
platforms:
- linux/amd64
- linux/arm64
images:
template:
image: my-template
dockerfile: docker/Dockerfile.template
context: .
blob:
image: my-blob
dockerfile: docker/Dockerfile.blob
context: ./blob
processor:
image: my-processor
dockerfile: docker/Dockerfile.processor
context: ./processor
plugin:
image: my-plugin
dockerfile: docker/Dockerfile.plugin
context: ./plugin
resolver:
image: my-resolver
dockerfile: docker/Dockerfile.resolver
context: ./resolver

Usage

Building Images

Use the build command to build and push images:

cyanprint build v1.0.0

The command:

  1. Reads the build: section from cyan.yaml
  2. Builds each defined image using Docker buildx
  3. Pushes images to the configured registry

Build with Push

Use push --build to build and publish in one step:

# Build and push a template
cyanprint push template --build v1.0.0 --token $CYAN_TOKEN
# Build and push a processor
cyanprint push processor --build v1.0.0 --token $CYAN_TOKEN
# Build and push a plugin
cyanprint push plugin --build v1.0.0 --token $CYAN_TOKEN
# Build and push a resolver
cyanprint push resolver --build v1.0.0 --token $CYAN_TOKEN

Platform Override

Override configured platforms via CLI:

# Use CLI-specified platform instead of config
cyanprint build v1.0.0 --platform linux/amd64

Platform Resolution

Platforms are resolved in this order:

  1. CLI --platform option (highest priority)
  2. build.platforms from config
  3. Current platform (fallback)