kase

command module
v0.0.0-...-ec96f79 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 2, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

README

kase

Kase is a container runtime I implemeted to learn about the inner workings of container runtimes. This project uses opencontainer's libcontainer package to handle the low level interfacing with the linux kernel.

Installation


$ git clone https://github.com/bxffour/kase
$ cd kase/

Build

To build with default options:

$ make build/kase

To tweak the build tags

$ BUILDTAGS="your_tags" make build/kase

Install

To you must run the install target with root privileges if you're going with the default install path

# make install/kase

To specify your own install path

$ INSTALLDIR=/path/to/dir make install/kase

Demo

installation


Integrating kase into Docker

To integrate into docker the kase executable must be installed into the default install directory if you don't plan on editing the daemon.json file. In the case where you tweaked the install directory, edit the extras/daemon.json file as follows:

{
    "default-runtime": "kase",
    "runtimes": {
        "kase": {
            "path": "/YOUR/INSTALL/DIR/kase",
            "runtimeArgs": []
        }
    }
} 

To add kase to the list of docker runtimes and set it as default:

# make integrate/docker

If for some reason you have a non standard docker config directory !(/etc/docker)

# CFGDIR=/path/to/dir make integrate/docker

Cleanup daemon.json:

# CFGDIR=/path/to/config make cleanup/docker

Demo

docker

Usage


Skopeo and Umoci can be used to download and unpack OCI bundles to be used with kase

$ skopeo copy docker://alpine:latest oci:alpine:latest
$ umoci unpack --image alpine:latest alpine-bundle --rootless

To run a container

$ kase run -b alpine-bundle <container-id>

To create a container using bundle

$ kase create -b alpine-bundle <container-id>

To start a container

$ kase start <container-id>

To pause all processes in a given container

$ kase pause <container-id>

To delete a container

$ kase delete <container-id>

To list containers

$ kase list

For more info on oother commands run:

$ kase --help
$ kase [command] --help             // for help with a specific command

Credit

https://github.com/opencontainers/runc - My deepest thanks to the contributors and maintainers of the runc project. Studying its well documented source made me undoubtedly taught me invaluable lessons on Go, linux and systems programming.

other projects

https://github.com/duyanghao/sample-container-runtime

https://unixism.net/2020/06containers-the-hard-way-gocker-a-mini-docker-written-in-go/

Documentation

Overview

Copyright © 2022 Nana Kwadwo <agyemang.nana.b@gmail.com>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Directories

Path Synopsis
credit: https://github.com/opencontainers/runc
credit: https://github.com/opencontainers/runc

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL