Skip to content

Getting started

Anna Sancho Vaquer edited this page Oct 20, 2026 · 3 revisions

This page walks you from an empty template to a published rock.

1. Create your repository

Create a new repository from the template by following GitHub's guide on creating a repository from a template. Use canonical/rocks-template as the template.

The repository visibility matters:

Visibility What you need to do
Public Nothing extra. Note that Pro-enabled rocks cannot be uploaded to GHCR.
Private / Internal Create the REPO_CLONER_TOKEN secret, otherwise the build job cannot check out the repository.

2. Customize the template

File Action
README.md Replace the placeholder with your rock's own README.
CODEOWNERS Optional but recommended: add the teams or people responsible for the rock. See about code owners for more information on CODEOWNERS.
.github/ci.yaml Review the defaults (GHCR upload and CVE scan enabled, one image at the repository root).
rockcraft.yaml Add it. This is your rock's recipe.
spread.yaml and spread/ Add them to test the rock.

You do not need to edit the files under .github/workflows/ to get started.

3. Build locally

Before committing, pack the rock locally with Rockcraft to catch problems early:

sudo snap install rockcraft --classic
rockcraft pack

See Defining your rock for more information on local builds. You can also test your rock locally. This is optional.

4. Push and watch the pipeline

Commit your files and push them. In the Actions tab of your repository you will see the following:

  • Rock CI pipeline: runs on pushes and pull requests targeting main, and can be started manually. It validates the configuration, builds, tests and (only on main) uploads the rock.
  • Threat monitor: runs daily and scans the published images for vulnerabilities.

After a successful run on main, your rock is available at:

ghcr.io/<owner>/<repository>/<rock-name>:<version>-<base>_edge

An example of the this is ghcr.io/my-org/my-rocks/my-rock:0.1-24.04_edge. See how tags are derived.

Next steps

Clone this wiki locally