This repository contains the base Docker image with pre-compiled Cryo binary for fast application builds.
Building Cryo from source takes several hours, especially for ARM64 architecture. This base image is built weekly (or on-demand) and contains:
- Pre-compiled Cryo binary (specific commit:
eba6192298e40add4d35d1587511d875f6d770e4) - Custom patches for enhanced functionality
- Python 3 runtime
- All necessary system dependencies (libssl, gcc, g++)
In your application's Dockerfile:
FROM ghcr.io/gnosischain/cryo-base:latest
# Your application code here
WORKDIR /app
COPY . .
# ...One can run this version as
docker run --rm -v "$(pwd)":/data cryo-base:latest \
cryo blocks \
--blocks 39828831:39828831 \
--rpc 'URL' \
--include-columns block_number timestamp withdrawals_root withdrawals \
-o /dataThis image includes a modular patching system. Current patches:
| Patch | Description |
|---|---|
01_null_traces.py |
Makes trace functions null-safe for RPCs that return null instead of [] |
02_withdrawals.py |
Adds withdrawals column support to blocks dataset |
-
Create a new file in
patches/with the naming patternNN_patch_name.py(numeric prefix controls execution order) -
Use this template structure:
#!/usr/bin/env python3
from pathlib import Path
DESCRIPTION = "Short description of what this patch does"
TARGET_FILE = Path("crates/freeze/src/path/to/file.rs")
def main():
# Return True (success), False (failure), or "skipped" (already applied)
...-
The patch runner (
apply_patches.py) will automatically discover and apply patches in alphabetical order -
Build the image to apply:
docker build -t cryo-base .See patches/_template.py.example for a full template.
.
├── Dockerfile
├── README.md
├── apply_patches.py # Patch runner script
└── patches/
├── 01_null_traces.py
├── 02_withdrawals.py
└── _template.py.example
- Automatic builds: Every Sunday at 2 AM UTC
- Manual builds: On push to main branch or via workflow dispatch
To trigger a manual build with a specific Cryo commit:
- Go to Actions → "Build Cryo Base Image"
- Click "Run workflow"
- Optionally specify a Cryo commit hash
- Click "Run workflow"
latest: Always points to the most recent buildYYYYMMDD: Date-based tags for specific versions
- linux/amd64
- linux/arm64
Both architectures are built in parallel for faster builds.
When Cryo releases a new version:
- Update the commit hash in
Dockerfile - Push to main branch or trigger manual build
- Wait for build completion (usually 2-3 hours)
- Update your application to use the new base image
To add a new patch:
- Add your patch file to
patches/directory - Follow the naming convention
NN_description.py - Implement
DESCRIPTION,TARGET_FILE, andmain()function - Push to main branch or trigger manual build
The base image includes:
- Debian bullseye-slim base
- Cryo binary at
/usr/local/bin/cryo(with custom patches) - Python 3.x with pip
- Build essentials (gcc, g++)
- OpenSSL libraries
- CA certificates