Skip to content

Container runtime for small-scale development environments.

License

Notifications You must be signed in to change notification settings

pyxgun/karakuri

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

83 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

License Version

Introduction

karakuri is a container runtime for small-scale development environments.
karakuri provides the following features.

  • Management of container lifecycle, including creation, running, and removal
  • Support for image pulling from Docker Hub and Private Registry
  • Support for image pushing to Priavte Registry
  • Support for image build
  • Supports on x86_64 and Arm architecture
  • Resourcce limitation of containers by cgroup v2
  • Container grouping and isolation network by namespace
  • Management and execution of core functions (e.g. dns, ingress, etc) through module functionality
  • Connecting to remote node and managing container
  • Connecting to the Registry and Repository/Tag Management

Components

karakuri consists of three components.

  1. karakuri
    A CLI tool that provides the ability to send requests to high-level container runtime.
  2. hitoha
    High-level container runtime.
    Runs as a daemon process and performs container networking, lifecycle management and image management.
    hitoha provides a REST API as an interface and executes low-level container runtime in response to received requests.
    In addition, hitoha will provide add-on functions such as module functions and registry connection functions.
  3. futaba
    Low-level container runtime.
    futaba provides actual container operation, including namespace isolation, mounts, root filesystem changes, etc.

Building

Pre-requisites

Before building karakuri, must install some utilitis.
On Ubuntu/Debian:

$ snap install go --classic
$ apt update && apt install -y cgroup-tools iptables

And also you'll need to edit pkgs/host_info.go according to your environment.
Change the host's NIC:HOST_NIC, OS:HOST_OS and architecture:HOST_ARCH as necessary.

// ====================================
//
//	Edit to match your environment
//
// ====================================
const (
	// Set your host nic
	HOST_NIC = "eth0"
	//HOST_NIC = "wlan0"

	// Set your os/architecture
	HOST_OS   = "linux"
	HOST_ARCH = "amd64"
	//HOST_ARCH = "arm"
)

This parameter is used to specify the architecture for the container network setup and image pulling.
If this parameter is different from the execution environment, the container may not be set up correctly.

Build

$ git clone https://github.com/pyxgun/karakuri.git
$ cd karakuri

$ sh scripts/build.sh

Test Run

$ sudo karakuri run --rm --it --image hello-world

Hello from Docker!
This message shows that your installation appears to be working correctly.
   :

Quick Start: Container Operation

The following is how to run container lifecycle.

Pull image (Optional)

Retrieve an image from registry. This operation is optional because if an image that doesn't exist local is specified when create command is executed, the image is automatically retrieved.

$ sudo karakuri pull --image alpine

Check the local image list.

$ sudo karakuri images

REPOSITORY      | TAG           | ID
----------------+---------------+-----------------
alpine          | latest        | b0c9d60fc5e3

Create container

Create a container.

$ sudo karakuri create --name mycontainer --image alpine

Check container list.

$ sudo karakuri ls

CONTAINER ID | Name        | IMAGE  | STATUS  | PORT | COMMAND
-------------+-------------+--------+---------+------+---------------
52e579b39313 | mycontainer | alpine | created |      | /bin/sh                         

Start container

Start the container.

$ sudo karakuri start --name mycontainer --it

/ # 

--it option is specified when executing commands that require standard output, such as shell and other interactive tools.

Delete container

Delete the container

$ sudo karakuri rm --name mycontainer

Quick Start: Image Operation

You can manage the local image storage.

Show image

$ sudo karakuri images

REPOSITORY    | TAG       | ID
--------------+-----------+-----------------
python        | alpine    | 6cf03fe1f23a
nginx         | alpine    | d41a14a4ecff
alpine        | latest    | b0c9d60fc5e3

Delete Image

$ sudo karakuri rmi --id [IMAGE_ID]

More Operation

Specification Documents

License

The code and docs are released under the MIT license.

About

Container runtime for small-scale development environments.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published