An open API service indexing awesome lists of open source software.

https://github.com/mikeyfennelly1/mrun

A low-level OCI compliant container runtime for modern Linux.
https://github.com/mikeyfennelly1/mrun

containerization go linux process-isolation

Last synced: 4 months ago
JSON representation

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

Awesome Lists containing this project

README

          

= mrun
:toc:

== Overview

mrun (**_m_**ike's **_run_**time) 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:

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

Validate your setup with the following command:

[source, bash]
----
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 https://github.com/opencontainers/runc[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.

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

==== Create a config.json
[source, bash]
mrun spec

==== Create a Container
[source, bash]
mrun create ./config.json

== Reading and documentation

During the creation of this project I did a lot of reading on containerization. I have created link:docs/[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!