charmos, or a third-party adapter/telemetry/memory plugin baked into the image.
runtime.custom_image tells the cloud runner which container image to pull. When set, it overrides the default adapter→image mapping from Base Images.
When you need this
| Goal | Typical setup |
|---|---|
| Extra Python/system deps only | type: custom + custom_image |
| Third-party adapter plugin | type: your_plugin + custom_image with plugin installed |
| Telemetry plugin on cloud | Typically no custom_image needed (runner auto-installs via requirements.txt) |
Private or pinned charmos version | Extend base image and install your SDK build |
custom_image for a normal charm init Python agent that runs on the default runner-base image.
1. Create a Dockerfile
Extend the official base image:[!WARNING] You must inherit from an official Charm base image. The cloud runner injects a bootstrap script and expectsbash,python3, and the corecharmosSDK to be pre-installed. Do not build from scratch (e.g.,FROM ubuntuorFROM python:3.11).
[!CAUTION] Always build forlinux/amd64. The cloud runners (Google Cloud Run / Fly.io) run onamd64architecture. If you are on an Apple Silicon Mac (M1/M2/M3) and build without the--platform linux/amd64flag, your agent will crash with anexec format error.
2. Declare the image in charm.yaml
3. Publish and run
custom_image and executes your bundle inside that container.
Registry access
| Registry visibility | Requirement |
|---|---|
| Public (GHCR public, etc.) | Runner pulls without extra IAM |
| Private | Grant the cloud runner service account read access to your registry |
Note on dynamic installation: The cloud runner does runuv pip install -r requirements.txtat boot time for lightweight dependencies (like Telemetry and Memory plugins). However, if your agent requires heavy ML packages, long compile times, or system-level dependencies (likeffmpeg), you must use acustom_imageto avoid the 300-second boot timeout.
Community Plugins
You can discover custom runtimes built by the community in the Charm Store (Plugins Tab). If you have built a custom runtime that others might find useful (e.g., an image pre-configured with Chromium, specialized ML models, or custom data pipelines), you can submit it to the official registry:- Fork the charm-community-plugin repository.
- Edit
runtimes/registry.jsonto include your image’s metadata and URL. - Submit a Pull Request.
custom_image field.
