A toolkit for building secure, portable and lean operating systems for containers
Go to file
Rolf Neugebauer e0c0a72bda
Merge pull request #2746 from justincormack/mkdir-state
Create state dir before trying to touch file in it
2017-11-16 17:17:59 +00:00
.circleci Add Circle CI runes 2017-11-07 10:17:44 +00:00
.github Change docker/linuxkit to linuxkit/linuxkit 2017-04-17 18:13:28 -05:00
blueprints blueprints: Update LCOW 2017-11-15 11:00:51 +00:00
docs Merge pull request #2703 from guillaumerose/multi 2017-11-14 13:39:27 +00:00
examples Bump runc yml 2017-11-15 09:34:06 +00:00
kernel wireguard: update to 0.0.20171111 2017-11-15 17:48:24 +01:00
logo Add the LinuxKit logos to the repo 2017-10-31 12:41:36 +00:00
pkg pkg/lcow: Update OpenGCS to latest 2017-11-15 10:57:55 +00:00
projects Create state dir before trying to touch file in it 2017-11-16 14:38:11 +00:00
reports sig-security: add okernel video and forum post 2017-08-22 14:09:03 -07:00
scripts update-component-sha: Accept easier to cut-n-paste --image arguments. 2017-10-13 10:46:57 +01:00
sigs Update SIG reports link 2017-05-15 14:02:48 -07:00
src/cmd/linuxkit Only add in ttyS1 to kernel cmdline on Packet if not there already 2017-11-15 15:39:08 +00:00
test tests: Update runc 2017-11-15 11:38:54 +00:00
tools tools: Remove the CoreOS grub2 patche 2017-11-10 06:25:40 +00:00
.gitattributes Update .gitattributes with new kernel config name 2017-10-23 11:23:05 +01:00
.gitignore kernel: Use local kernel source if available 2017-08-20 11:41:59 +01:00
.mailmap Update Authors 2017-11-03 15:21:46 +00:00
AUTHORS Update Authors 2017-11-03 15:21:46 +00:00
CONTRIBUTING.md Change docker/linuxkit to linuxkit/linuxkit 2017-04-17 18:13:28 -05:00
LICENSE add license, and files for opensourcing 2017-04-16 18:23:23 -05:00
linuxkit.yml Bump runc yml 2017-11-15 09:34:06 +00:00
MAINTAINERS Add Avi Deitcher as a maintainer 2017-06-28 12:24:19 +01:00
Makefile local-build: build a static + stripped binary by default 2017-11-07 10:17:44 +00:00
NOTICE add license, and files for opensourcing 2017-04-16 18:23:23 -05:00
poule.yml add basic poule configuration 2017-04-17 14:13:04 -05:00
README.md docs: Add documentation for the Raspberry Pi 3b 2017-11-07 11:23:44 +00:00

LinuxKit

LinuxKit, a toolkit for building custom minimal, immutable Linux distributions.

  • Secure defaults without compromising usability
  • Everything is replaceable and customisable
  • Immutable infrastructure applied to building Linux distributions
  • Completely stateless, but persistent storage can be attached
  • Easy tooling, with easy iteration
  • Built with containers, for running containers
  • Designed for building and running clustered applications, including but not limited to container orchestration such as Docker or Kubernetes
  • Designed from the experience of building Docker Editions, but redesigned as a general-purpose toolkit
  • Designed to be managed by external tooling, such as Infrakit or similar tools
  • Includes a set of longer-term collaborative projects in various stages of development to innovate on kernel and userspace changes, particularly around security

Getting Started

Build the moby and linuxkit tools

LinuxKit uses the moby tool for image builds, and the linuxkit tool for pushing and running VM images.

Simple build instructions: use make to build. This will build the tools in bin/. Add this to your PATH or copy it to somewhere in your PATH eg sudo cp bin/* /usr/local/bin/. Or you can use sudo make install.

If you already have go installed you can use go get -u github.com/moby/tool/cmd/moby to install the moby build tool, and go get -u github.com/linuxkit/linuxkit/src/cmd/linuxkit to install the linuxkit tool.

On MacOS there is a brew tap available. Detailed instructions are at linuxkit/homebrew-linuxkit, the short summary is

brew tap linuxkit/linuxkit
brew install --HEAD moby
brew install --HEAD linuxkit

Build requirements from source:

  • GNU make
  • Docker
  • optionally qemu

Building images

Once you have built the tool, use

moby build linuxkit.yml

to build the example configuration. You can also specify different output formats, eg moby build -format raw-bios linuxkit.yml to output a raw BIOS bootable disk image, or moby build -format iso-efi linuxkit.yml to output an EFI bootable ISO image. See moby build -help for more information.

Booting and Testing

You can use linuxkit run <name> or linuxkit run <name>.<format> to execute the image you created with moby build <name>.yml. This will use a suitable backend for your platform or you can choose one, for example VMWare. See linuxkit run --help.

Currently supported platforms are:

Running the Tests

The test suite uses rtf To install this you should use make bin/rtf && make install. You will also need to install expect on your system as some tests use it.

To run the test suite:

cd test
rtf -x run

This will run the tests and put the results in a the _results directory!

Run control is handled using labels and with pattern matching. To run add a label you may use:

rtf -x -l slow run

To run tests that match the pattern linuxkit.examples you would use the following command:

rtf -x run linuxkit.examples

Building your own customised image

To customise, copy or modify the linuxkit.yml to your own file.yml or use one of the examples and then run moby build file.yml to generate its specified output. You can run the output with linuxkit run file.

The yaml file specifies a kernel and base init system, a set of containers that are built into the generated image and started at boot time. You can specify the type of artifact to build with the moby tool eg moby build -format vhd linuxkit.yml.

If you want to build your own packages, see this document.

Yaml Specification

The yaml format specifies the image to be built:

  • kernel specifies a kernel Docker image, containing a kernel and a filesystem tarball, eg containing modules. The example kernels are built from kernel/
  • init is the base init process Docker image, which is unpacked as the base system, containing init, containerd, runc and a few tools. Built from pkg/init/
  • onboot are the system containers, executed sequentially in order. They should terminate quickly when done.
  • services is the system services, which normally run for the whole time the system is up
  • files are additional files to add to the image

For a more detailed overview of the options see yaml documentation

Architecture and security

There is an overview of the architecture covering how the system works.

There is an overview of the security considerations and direction covering the security design of the system.

Roadmap

This project was extensively reworked from the code we are shipping in Docker Editions, and the result is not yet production quality. The plan is to return to production quality during Q3 2017, and rebase the Docker Editions on this open source project during this quarter. We plan to start making stable releases on this timescale.

This is an open project without fixed judgements, open to the community to set the direction. The guiding principles are:

  • Security informs design
  • Infrastructure as code: immutable, manageable with code
  • Sensible, secure, and well-tested defaults
  • An open, pluggable platform for diverse use cases
  • Easy to use and participate in the project
  • Built with containers, for portability and reproducibility
  • Run with system containers, for isolation and extensibility
  • A base for robust products

Development reports

There are weekly development reports summarizing work carried out in the week.

FAQ

See FAQ.

Released under the Apache 2.0 license.