All Projects → samuelkarp → Runj

samuelkarp / Runj

Licence: other
runj is an experimental, proof-of-concept OCI-compatible runtime for FreeBSD jails.

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Runj

Image Spec
OCI Image Format
Stars: ✭ 1,851 (+777.25%)
Mutual labels:  containers, oci
Containership
A simple container management platform
Stars: ✭ 241 (+14.22%)
Mutual labels:  containers, oci
Selinux
common selinux implementation
Stars: ✭ 107 (-49.29%)
Mutual labels:  containers, oci
Rkt
[Project ended] rkt is a pod-native container engine for Linux. It is composable, secure, and built on standards.
Stars: ✭ 8,870 (+4103.79%)
Mutual labels:  containers, oci
Runtime Spec
OCI Runtime Specification
Stars: ✭ 2,316 (+997.63%)
Mutual labels:  containers, oci
Artifacts
OCI Artifacts
Stars: ✭ 84 (-60.19%)
Mutual labels:  containers, oci
Jib
🏗 Build container images for your Java applications.
Stars: ✭ 11,370 (+5288.63%)
Mutual labels:  containers, oci
Runc
CLI tool for spawning and running containers according to the OCI specification
Stars: ✭ 8,729 (+4036.97%)
Mutual labels:  containers, oci
Image Tools
OCI Image Tooling
Stars: ✭ 167 (-20.85%)
Mutual labels:  containers, oci
Orca Build
Build OCI images from Dockerfiles.
Stars: ✭ 159 (-24.64%)
Mutual labels:  containers, oci
Firecracker Containerd
firecracker-containerd enables containerd to manage containers as Firecracker microVMs
Stars: ✭ 1,130 (+435.55%)
Mutual labels:  containers, oci
Syft
CLI tool and library for generating a Software Bill of Materials from container images and filesystems
Stars: ✭ 196 (-7.11%)
Mutual labels:  containers, oci
Containerd
An open and reliable container runtime
Stars: ✭ 9,956 (+4618.48%)
Mutual labels:  containers, oci
Go Digest
Common digest package used across the container ecosystem
Stars: ✭ 99 (-53.08%)
Mutual labels:  containers, oci
Kata Containers
Kata Containers version 2.x repository. Kata Containers is an open source project and community working to build a standard implementation of lightweight Virtual Machines (VMs) that feel and perform like containers, but provide the workload isolation and security advantages of VMs. https://katacontainers.io/
Stars: ✭ 1,053 (+399.05%)
Mutual labels:  containers, oci
Ignite
Ignite a Firecracker microVM
Stars: ✭ 1,954 (+826.07%)
Mutual labels:  containers, oci
Crun
A fast and lightweight fully featured OCI runtime and C library for running containers
Stars: ✭ 990 (+369.19%)
Mutual labels:  containers, oci
Clair
Vulnerability Static Analysis for Containers
Stars: ✭ 8,356 (+3860.19%)
Mutual labels:  containers, oci
Gvisor
Application Kernel for Containers
Stars: ✭ 12,012 (+5592.89%)
Mutual labels:  containers, oci
Runtime
Kata Containers version 1.x runtime (for version 2.x see https://github.com/kata-containers/kata-containers).
Stars: ✭ 2,103 (+896.68%)
Mutual labels:  containers, oci

runj

runj is an experimental, proof-of-concept OCI-compatible runtime for FreeBSD jails.

Important: runj is a proof-of-concept and the implementation has not been evaluated for its security. Do not use runj on a production system. Do not run workloads inside runj that rely on a secure configuration. This is a personal project, not backed by the author's employer.

Status

runj is in early development and is functional, but has very limited features.

runj currently supports the following parts of the OCI runtime spec:

  • Commands
    • Create
    • Delete
    • Start
    • State
    • Kill
  • Config
    • Root path
    • Process args

Getting started

OCI bundle

To run a jail with runj, you must prepare an OCI bundle. Bundles consist of a root filesystem and a JSON-formatted configuration file.

Root filesystem

The root filesystem can consist either of a regular FreeBSD userland or a reduced set of FreeBSD-compatible programs. For experimentation, statically-linked programs from /recovery may be copied into your bundle. You can obtain a regular FreeBSD userland suitable for use with runj from http://ftp.freebsd.org/pub/FreeBSD/releases/$ARCH/$VERSION/base.txz (where $ARCH and $VERSION are replaced by your architecture and desired version respectively). Several demo convenience commands have been provided in runj to assist in experimentation; you can use runj demo download to retrieve a working root filesystem from the FreeBSD website.

Config

runj supports a limited number of configuration parameters for jails. The OCI runtime spec does not currently include support for FreeBSD. As this proof-of-concept is developed, FreeBSD-related configuration parameters can be added to the upstream specification. For now, the extensions are documented here

You can use runj demo spec to generate an example config file for your bundle.

Once you have a config file, edit the root path and process args to your desired values.

Lifecycle

Create a container with runj create $ID $BUNDLE where $ID is the identifier you picked for your container and $BUNDLE is the bundle directory with a valid config.json.

Start your container with runj start $ID. The process defined in the config.json will be started.

Inspect the state of your container with runj state $ID.

Send a signal to your container process (or all processes in the container) with runj kill $ID.

Remove your container with runj delete $ID.

containerd

Along with the main runj OCI runtime, this repository also contains an experimental shim that can be used with containerd. The shim is available as containerd-shim-runj-v1 and can be used from the ctr command-line tool by specifying --runtime wtf.sbk.runj.v1.

A special build of containerd is currently required as not all the necessary patches for FreeBSD support have yet been merged upstream. You can find the set of patches used on the freebsd branch on my fork of containerd.

OCI Image

runj contains a utility that can convert a FreeBSD root filesystem into an OCI image that can be imported into containerd. You can download, convert, and import an image as follows:

$ runj demo download --output rootfs.txz
Found arch:  amd64
Found version:  12.1-RELEASE
Downloading image for amd64 12.1-RELEASE into rootfs.txz
[...output elided...]
$ runj demo oci-image --input rootfs.txz
Creating OCI image in file image.tar
extracting...
compressing...
computing layer digest...
writing blob sha256:f585dd296aa9697b5acaf9db7b40701a6377a3ccf4d29065cbfd3d2b80395733
writing blob sha256:4356d99aa6bcea46611c0108af469129e7013a4d121567c2fbd0e753e8e073cf
tar...
$ sudo ctr image import --index-name freebsd image.tar
unpacking freebsd (sha256:960c76846cd112e09032c88914458faee8d03c04b8260dfbc4da70b25227534a)...done

Implementation details

runj uses FreeBSD's userland utilities for managing jails; it does not directly invoke the jail-related syscalls. You must have working versions of jail(8), jls(8), jexec(8), and ps(1) installed on your system. runj kill makes use of the kill(1) command inside the jail's rootfs; if this command does not exist (or is not functional), runj kill will not work.

Future

Resource limits on FreeBSD can be configured using the kernel's RCTL interface. runj does not currently use this, but may add support for it via rctl(8) in the future.

License

runj itself is licensed under the same license as the FreeBSD project. Some dependencies are licensed under other terms. The OCI runtime specification and reference code is licensed under the Apache License, 2.0; copies of that reference code incorporated and modified in this repository remain under the original license.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].