LogoCyanPrint

Push to Registry

How to build and publish templates to a registry

How to Push to Registry

Build and publish your template to make it available for others to use.

Prerequisites

  • Docker with buildx support
  • Access to a Docker registry (Docker Hub, GHCR, or private)
  • CyanPrint CLI for registration

Build Template Image

Build the template image for multiple architectures:

docker buildx build --platform linux/amd64,linux/arm64 \
-f cyan/template.Dockerfile \
-t myorg/my-template:1.0.0 \
--push .

The --push flag pushes immediately after build.

Build Blob Image

Build the blob image containing your template files:

docker buildx build --platform linux/amd64,linux/arm64 \
-f cyan/blob.Dockerfile \
-t myorg/my-template-blob:1.0.0 \
--push .

Register with CyanPrint

Register your template with the CyanPrint registry:

cyanprint push template --token $CYAN_TOKEN \
myorg/my-template-blob 1.0.0 \
myorg/my-template 1.0.0

Build Options

Multi-Architecture Builds

Build for multiple platforms:

docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 \
-f cyan/template.Dockerfile \
-t myorg/my-template:1.0.0 \
--push .

Build Without Push

Build locally for testing:

docker buildx build --platform linux/amd64 \
-f cyan/template.Dockerfile \
-t myorg/my-template:dev \
--load .

The --load flag loads the image into Docker for local use.

Version Tagging

Use semantic versioning:

# Tag with version
docker buildx build -t myorg/my-template:1.0.0 --push .
# Also tag latest
docker buildx build -t myorg/my-template:latest --push .

Registry Options

Docker Hub

docker login
docker buildx build -t docker.io/myorg/my-template:1.0.0 --push .

GitHub Container Registry

echo $GITHUB_TOKEN | docker login ghcr.io -u USERNAME --password-stdin
docker buildx build -t ghcr.io/myorg/my-template:1.0.0 --push .

Private Registry

docker login registry.example.com
docker buildx build -t registry.example.com/myorg/my-template:1.0.0 --push .

Verification

Verify your template is published:

# List templates
cyanprint list myorg/
# Get template info
cyanprint info myorg/my-template:1.0.0

CI/CD Integration

GitHub Actions

.github/workflows/publish.yml
name: Publish Template
on:
release:
types: [published]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and Push Template
run: |
docker buildx build --platform linux/amd64,linux/arm64 \
-f cyan/template.Dockerfile \
-t ghcr.io/${{ github.repository_owner }}/my-template:${{ github.event.release.tag_name }} \
--push .
- name: Build and Push Blob
run: |
docker buildx build --platform linux/amd64,linux/arm64 \
-f cyan/blob.Dockerfile \
-t ghcr.io/${{ github.repository_owner }}/my-template-blob:${{ github.event.release.tag_name }} \
--push .
- name: Register with CyanPrint
run: |
cyanprint push template --token ${{ secrets.CYAN_TOKEN }} \
ghcr.io/${{ github.repository_owner }}/my-template-blob ${{ github.event.release.tag_name }} \
ghcr.io/${{ github.repository_owner }}/my-template ${{ github.event.release.tag_name }}

See Docker vs Cyan Registry for the differences between Docker registries and CyanPrint's internal registry.