Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
/diyCPublic

A simple educational linux container runtime.

License

NotificationsYou must be signed in to change notification settings

w-vi/diyC

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A simple educational Linux container runtime.

It is intentionally simple and leaves a lot of stuff out. It is asingle C file of roughly 500 lines including comments showing the corefeatures of the Linux used to build containers. It includes also thecreation of a container from an image to clarify how images andcontainers are related.

Documentation

http://wvi.cz/diyC/ or pure markdownin the docs directory.

Prerequisites

This is a educational piece of software and has not been tested onmany systems, here are the prerequisites:

  • recent Linux kernel supporting needed namespaces and cgroups
  • overlayfs
  • ip tool (iproute2 package)
  • iptables
  • gcc
  • make
  • bash

Apart from overlayfs most of the distros are prepared and ready, if notplease consult your distro package manager. Overlayfs is in themainline kernel so it should be straightforward.

Note: Kernel needs to be configured to support following namespacesPID, mount, network and UTS, cgroups are needed as well. Most of the GNU/Linux distros havethis support enabled by default.

Installation

  1. make setup

It creates the necessary directory structure as well as prepares thenetworking part like iptables rules, bridge (diyc0) and so on. Toremove the networking bits like bridge and iptables rules runmake net-clean which removes them all.

  1. make

Builds the runtime.

  1. Done

It also builds ansexec which executes a local command in namespaces. Seensexec --help to see what namespaces are available. Usage is very simplesudo ./nsexec -pnu myhost bash will start a new bash in new pid, network and UTS namespace.

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp