Skip to content

A low-level OCI compliant container runtime for modern Linux.

Notifications You must be signed in to change notification settings

mikeyfennelly1/mrun

Repository files navigation

mrun

Overview

mrun (mike’s runtime) is a low level, OCI compliant container runtime written in Go. The mrun container runtime is exclusive to Linux, and will probably work best on Ubuntu.

Note

This runtime is created to be compatible with Linux operating systems that have systemd as the init system. I did not create this runtime to be reliable/platform independant. Do not rely on this runtime.

What is a container?

The Open Container Initiative (OCI) defines a container as a standardized, portable, and lightweight runtime environment for software that bundles an application and its dependencies, libraries, and configuration files.

Usage

System Prerequisites

My system is Ubuntu 22.04 using Linux Kernel v6.8. I recommend that you use some similar Ubuntu/Debian-based system, but ideally as close as possible. I can not guarantee portability as of now.

systemd, a filesystem that supports extended attributes and a Kernel newer than v4.5 - to have cgroupv2 support. If you are currently running Linux, this configuration is more than likely already the case for your setup, but just to make note of these in case of unexpected behaviors.

Install

Run the installation script with the following command:

curl -fsSL https://raw.githubusercontent.com/mikeyfennelly1/mrun.git/scripts/install.sh | bash

Validate your setup with the following command:

mrun --version

Spawning a container

To start a container you need an OCI compliant specification (config.json) file, specifying your containerized environment, and a directory for your container’s environment filesystem, with the directory titled 'rootfs' - both in your current working directory. For now (until I implement mrun spec) use runc spec from the runc container runtime.

Get a Container filesystem

I recommend that to get started just testing out low level container stuff, you use alpine as your first rootfs.

curl -fsSL https://raw.githubusercontent.com/mikeyfennelly1/mrun/main/scripts/install-mini-alpine.sh | bash

Create a config.json

mrun spec

Create a Container

mrun create ./config.json

Reading and documentation

During the creation of this project I did a lot of reading on containerization. I have created documentation which has some reading that can be a bit more approachable to a newcomer than trying to sieve through the internet for reading material. Containers are quite a complex topic, and I hope that these docs can help understand some of the elements involved.

The docs folder has reading about OCI standards and Kernel features that underpin container technology like control groups (cgroups).

Enjoy!

About

A low-level OCI compliant container runtime for modern Linux.

Topics

Resources

Stars

Watchers

Forks