Pulls in a bumper crop of updates from last year and some recent improvements: $ git log --oneline 3e8ed35ca934..f2409214ca3b | cat f240921 Merge pull request #38 from ijc/timestamp-precision f626ffe Preserve full precision in nanoseconds part of log timestamp 29c89e8 Merge pull request #37 from rn/ps1 600ea59 Update documentation with new powershell features 9fed685 Add powershell test and group templates and a stub library 3ada6bd Don't use '#!/bin/sh' in tests or group initialisers dd187b4 Add test cases for powershell scripts 4892754 Add support for writing tests in powershell (on Windows) 00cdd1f Add the ability to execute powershell scripts 00906da Add TestFilePath to the Test struct e6fdcb7 Add GroupFilePath to the Group struct c590dbc Make group member names for Pre/Post test scripts clearer 5ca3d4f Add setEnv test d178af2 Improve environment variable setting in executeScript 9c7cc94 Merge pull request #35 from rn/circle d464092 Use container builds on CircleCI and stash artefacts 9a09cd5 Move CircleCI config file to .circleci 9429279 Merge pull request #33 from rn/poule 4de1f2c Add poule config 88dcc27 Merge pull request #32 from mor1/extra-extra bfabb8a flags: update README for `-x` now as a local flag 3f574c7 flags: make `-x` work ba442d6 Merge pull request #31 from dave-tucker/fix-panic 6c7f09b local: Fix panic when no pattern is supplied 617e977 Merge pull request #30 from dnephin/add-latest-link 5829b2b Merge pull request #29 from dnephin/fix-command-descriptions d09a317 Add a link to the latest directory within results. c9a9a2a Remove some duplication between commands. 7904cc7 Remove unused flags, and move run flags to run command. 94e56a7 Update command descriptions faedeef Merge pull request #28 from dave-tucker/prepost a5f92ae local: Fix panic in PostTest 23fbbea Merge pull request #26 from dave-tucker/fix-osx-vers 156281e sysinfo: Fix OSX version parsing Signed-off-by: Ian Campbell <ijc@docker.com> |
||
---|---|---|
.circleci | ||
.github | ||
contrib | ||
docs | ||
examples | ||
kernel | ||
logo | ||
pkg | ||
projects | ||
reports | ||
scripts | ||
sigs | ||
src/cmd/linuxkit | ||
test | ||
tools | ||
.gitattributes | ||
.gitignore | ||
.mailmap | ||
AUTHORS | ||
CONTRIBUTING.md | ||
LICENSE | ||
linuxkit.yml | ||
MAINTAINERS | ||
Makefile | ||
NOTICE | ||
poule.yml | ||
README.md |
LinuxKit
Security Update 17/01/2018: All current LinuxKit x86_64
kernels
have KPTI/KAISER enabled by default. This protects against
Meltdown. Defences against
Spectre are work in progress
upstream and some have been incorporated into 4.14.14/4.9.77 onwards
but work is still ongoing. The kernels 4.14.14/4.9.77 onwards also
include various eBPF and KVM fixes to mitigate some aspects of
Spectre. The arm64
kernels are not yet fixed. See Greg KH's
excellent
blogpost and
this LWN.net
article for
details.
If you run LinuxKit kernels on x86 baremetal we also strongly
recommend to add ucode: intel-ucode.cpio
to the kernel section of
your YAML if you are using Intel CPUs and linuxkit/firmware:<hash>
if
you are using AMD CPUs.
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
Subprojects
- LinuxKit kubernetes aims to build minimal and immutable Kubernetes images. (previously
projects/kubernetes
in this repository).
Getting Started
Build the linuxkit
tool
LinuxKit uses the linuxkit
tool for building, pushing and running VM images.
Simple build instructions: use make
to build. This will build the tool 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/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 linuxkit
Build requirements from source:
- GNU
make
- Docker
- optionally
qemu
Building images
Once you have built the tool, use
linuxkit build linuxkit.yml
to build the example configuration. You can also specify different output formats, eg linuxkit build -format raw-bios linuxkit.yml
to
output a raw BIOS bootable disk image, or linuxkit build -format iso-efi linuxkit.yml
to output an EFI bootable ISO image. See linuxkit build -help
for more information.
Since linuxkit build
is built around the Moby tool the input yml files are described in the Moby tool documentation.
Booting and Testing
You can use linuxkit run <name>
or linuxkit run <name>.<format>
to execute the image you created with linuxkit 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:
- Local hypervisors
- Cloud based platforms:
- Baremetal:
- x86 and arm64 servers on packet.net
- Raspberry Pi Model 3b
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 linuxkit 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 linuxkit 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 fromkernel/
init
is the baseinit
process Docker image, which is unpacked as the base system, containinginit
,containerd
,runc
and a few tools. Built frompkg/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 upfiles
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.