osal.sandbox #
specs see https://github.com/opencontainers/runtime-spec/blob/main/config.md
fn install #
fn install() !
install runc
fn new #
fn new(args_ FactoryArgs) !Factory
struct Container #
struct Container {
pub mut:
name string
path_config pathlib.Path
path_root pathlib.Path
path_io pathlib.Path
startcmd []string
factory &Factory @[skip; str: skip]
}
fn (Container) debootstrap #
fn (mut c Container) debootstrap(args_ DebootstrapArgs) !
fn (Container) start #
fn (mut c Container) start() !
struct ContainerArgs #
@[params]
struct ContainerArgs {
pub mut:
name string = 'ubuntu'
path_prefix string = '/tmp'
path_config string = '@PREFIX/data/@NAME/config'
path_root string = '@PREFIX/data/containers/@NAME/fs'
path_io string = '@PREFIX/data/containers/@NAME/io'
startcmd []string = ['/bin/bash']
}
struct DebootstrapArgs #
@[params]
struct DebootstrapArgs {
pub mut:
imagename string @[required]
reset bool = true
release string = 'stable'
repository string = 'http://deb.debian.org/debian/'
}
struct Factory #
@[heap]
struct Factory {
pub mut:
path_images pathlib.Path
imagesources map[string]ImageSource
}
fn (Factory) container_new #
fn (mut f Factory) container_new(args_ ContainerArgs) !Container
fn (Factory) debootstrap #
fn (mut f Factory) debootstrap(args_ DebootstrapArgs) !
struct FactoryArgs #
@[params]
struct FactoryArgs {
pub mut:
path_images string = '/data/containers/images'
}
struct ImageSource #
struct ImageSource {
pub mut:
repository string
release string
}