Rockcraft
A rock solid foundation
for crafting containers
Build minimal, hardened, OCI-compliant Ubuntu container images with Rockcraft.
Let Rockcraft handle the boilerplate of your container builds so you can focus on your application’s code.
Why Rockcraft?
Rockcraft is Canonical’s specialized CLI tool for creating rocks, a new generation of securely-designed, stable, and OCI-compliant container images, based on Ubuntu.
Minimal setup
Rockcraft supports a variety of language-specific plugins, removing the overhead for a developer to set up their own language environment in order to build and stage their application into the final container image.
Seamless chiseling
Rockcraft integrates with Canonical’s Chisel tool to build minimal container images from slices of the Ubuntu distribution, ensuring that customers package only what is needed for their application, and nothing more.
Declarative simplicity
Rockcraft uses a declarative, rather than imperative, approach to build containers. This lowers the barrier to entry for new container developers, while saving time and reducing maintenance overhead for experienced engineers.
Ecosystem integration
Rockcraft is built on top of existing concepts within the same family as Snapcraft and Charmcraft, making adoption seamless for developers that are already building snaps and charms.
Developer workflow
Learn about some of the high-level commands you can use to build a rock, from generating the base configuration file to publishing a rock to a registry.
-
a. Initialize (without extension)
rockcraft initRun
rockcraft initto generate a baserockcraft.yamlb. Initialize (with extension)
rockcraft init --profile spring-boot-frameworkRockcraft offers various extensions, including
spring-boot-framework. Using the above command, Rockcraft automates the creation of arockcraft.yamlfile and tailors the file for a Spring Boot application. -
Declare
# Metadata section
name: hello
summary: Hello World
description: The most basic example of a rock.
version: "latest"
license: Apache-2.0
base: bare
build-base: [email protected]
platforms:
amd64: # Make sure this value matches your computer's architecture
# Parts section
parts:
hello:
plugin: nil
stage-packages:
- helloDefine your application dependencies, base OS, and parts in the
rockcraft.yamlfile. -
Pack
rockcraft packRun
rockcraft packto process parts and create the final artefact. -
Publish
rockcraft.skopeo --insecure-policy copy
oci-archive:<your_rock_file.rock>
docker://<container_registry>/<repo>:<tag>Publish a rock to a registry.
Developer-friendly,
enterprise-ready
- Ultra-small chiseled images: Rockcraft’s native integration with Chisel means that developers can build minimal images containing only the exact dependencies the application needs to run at runtime, stripping out shells, package managers, and unused libraries.
- Reduced attack surface: Because chiseled images contain no unused utilities or package contents, entire classes of supply-chain attacks are mitigated by default.
- Superior init process: Rockcraft embeds Pebble as the standard entrypoint (PID 1). Pebble orchestrates services natively using declarative YAML. This prevents the security risks associated with using imperative shell scripts to manage local service processes.
- Streamlined CI/CD: Rockcraft integrates directly with GitHub Actions (through the Rockcraft Pack action), and allows you to outsource remote builds to Canonical’s Launchpad build farm.
- No heavy lifting: Instead of writing messy wrapper scripts to manage how your application starts, Rockcraft uses Pebble as the built-in entrypoint. It automatically handles signal forwarding, graceful shutdowns, and log rotation for you.
- Cross-compilation made easy: Need to ship your app for ARM servers or Raspberry Pis? Rockcraft handles cross-compilation seamlessly without requiring you to maintain separate build environments.
- No more boilerplate: You don't need to string together complex shell scripts or worry about the exact order of
RUN,APT, andENVcommands. Rockcraft uses a clean, declarativerockcraft.yamlfile that handles the boilerplate for you. - Quick start with extensions: Rockcraft includes built-in extensions for 12-factor apps. Just tell Rockcraft which framework you are using, and it automatically configures the environment, dependencies, and entrypoints.
- Familiar Ubuntu environment: If you know how to use Ubuntu, you know how to use Rockcraft. The underlying bases are the exact same Ubuntu LTS releases you are used to, meaning your code runs the same way in the container as it does on your local machine.
Technical deep dive
Rockcraft forgoes the traditional, linear execution of Dockerfiles in favor of a declarative, component-based architecture.

The parts lifecycle
Rockcraft divides your app into modular blocks called parts. When a part is processed, it performs steps from the parts lifecycle: pull, overlay, build, stage, and prime.

Declarative chiseling
Rockcraft natively integrates with Chisel directly inside the YAML. Rather than starting with a full OS layer, developers can select the bare base and define precise slices.

Built-in plugins
You do not need to write custom build scripts or manually configure virtual environments. Rockcraft handles ecosystem-specific build logic natively through its plugin ecosystem.

12-factor app ready
Rockcraft provides built-in extensions for modern cloud-native web apps (Django, Flask, FastAPI, Node.js, Go), which silently inject a pre-configured underlying part.
Try it out for yourself
Get started with Rockcraft.