Skip to content

installers.virt.crun_installer #

crun_installer

Installer for the crun container runtime - a fast and lightweight OCI runtime written in C.

Features

  • Simple Package Installation: Installs crun via system package manager
  • Cross-Platform Support: Works on Ubuntu, Arch Linux, and macOS
  • Clean Uninstall: Removes crun cleanly from the system

Quick Start

Using V Code

import incubaid.herolib.installers.virt.crun_installer

mut crun := crun_installer.get()!

// Install crun
crun.install()!

// Check if installed
if crun.installed()! {
    println('crun is installed')
}

// Uninstall crun
crun.destroy()!

Using Heroscript

!!crun_installer.install

!!crun_installer.destroy

Platform Support

  • Ubuntu/Debian: Installs via apt
  • Arch Linux: Installs via pacman
  • macOS: ⚠️ Not supported - crun is Linux-only. Use Docker Desktop or Podman Desktop on macOS instead.

What is crun?

crun is a fast and low-memory footprint OCI Container Runtime fully written in C. It is designed to be a drop-in replacement for runc and is used by container engines like Podman.

See Also

  • crun client: lib/virt/crun - V client for interacting with crun
  • podman installer: lib/installers/virt/podman - Podman installer (includes crun)

Constants #

const version = '0.0.0'

fn delete #

fn delete(args ArgsGet) !

fn exists #

fn exists(args ArgsGet) !bool

does the config exists?

fn get #

fn get(args ArgsGet) !&CrunInstaller

fn heroscript_loads #

fn heroscript_loads(heroscript string) !CrunInstaller

///////////NORMALLY NO NEED TO TOUCH

fn list #

fn list(args ArgsList) ![]&CrunInstaller

if fromdb set: load from filesystem, and not from mem, will also reset what is in mem

fn new #

fn new(args ArgsGet) !&CrunInstaller

fn play #

fn play(mut plbook PlayBook) !

fn set #

fn set(o CrunInstaller) !

register the config for the future

fn switch #

fn switch(name string)

switch instance to be used for crun_installer

struct ArgsGet #

@[params]
struct ArgsGet {
pub mut:
	name   string = 'default'
	fromdb bool // will load from filesystem
	create bool // default will not create if not exist
}

///////FACTORY

struct ArgsList #

@[params]
struct ArgsList {
pub mut:
	fromdb bool // will load from filesystem
}

struct CrunInstaller #

@[heap]
struct CrunInstaller {
pub mut:
	name string = 'default'
}

CrunInstaller manages the installation of the crun container runtime

fn (CrunInstaller) destroy #

fn (mut self CrunInstaller) destroy() !

fn (CrunInstaller) install #

fn (mut self CrunInstaller) install(args InstallArgs) !

fn (CrunInstaller) installed #

fn (self &CrunInstaller) installed() !bool

checks if crun is installed

fn (CrunInstaller) reload #

fn (mut self CrunInstaller) reload() !

load from disk and make sure is properly intialized

struct InstallArgs #

@[params]
struct InstallArgs {
pub mut:
	reset bool
}