Kleene Documentation¶
Kleene is a container management tool for FreeBSD, similar to Docker but using FreeBSD jails, ZFS and PF.
Kleene is under active development. See the project status.
Pick your path¶
-
Install Kleene
Install Kleened and Klee from packages, ports or source.
-
Get started
Containerize an application, persist its data, connect containers together — a step-by-step introduction to Kleene.
-
Build images
Write a Dockerfile, understand the build context, and keep images small.
-
Run containers
Start containers in the foreground or detached, constrain their resources, and tune them with jail parameters.
-
Networking
ipnet,vnetandhostnetworking, published ports, and the firewall rules Kleene manages for you. -
Reference
Every
kleecommand, the Kleened REST API, and the Dockerfile syntax Kleene implements.
Kleene in 60 seconds¶
Download a FreeBSD base image and run a command in a container:
$ klee image create fetch-auto
...
Succesfully extracted binaries, creating image...
Created image from the automatically detected version: FreeBSD-15.1-RELEASE-p3 amd64.
image created
a1041764afd3
$ klee run FreeBSD-15.1-RELEASE-p3:latest echo hello
ffd0f89c3259
created execution instance 665e02ab151a
hello
executable 665e02ab151a and its container exited with exit-code 0
Describe an image in a Dockerfile and build it with klee build:
Coming from Docker?¶
Kleene defines itself relative to Docker. Most concepts map directly, but Kleene runs full FreeBSD userlands in jails backed by ZFS, has no image registry, and implements a subset of the Dockerfile instructions. See Kleene for Docker users for the full picture.
| Docker | Kleene |
|---|---|
docker ps -a | klee lsc -a |
docker images | klee lsi |
docker run | klee run |
docker build | klee build |
docker exec | klee exec |
docker network create | klee network create |
docker volume create | klee volume create |
bind mount -v /host:/ctr | klee run --mount /host:/ctr |
docker compose | no equivalent |
Common tasks¶
| Task | Page |
|---|---|
| Publish a port | Networking: publish ports |
| Mount a host directory | Storage: nullfs mounts |
| Persist data in a volume | Storage: volumes |
| Start containers at boot | Running: start automatically |
| Set jail parameters | Running: jail parameters |
| Limit CPU and memory | Running: resource constraints |
| Create a base image | Building: base images |
| Protect the Kleened socket | Operating: protect the Kleened socket |
| Customize the firewall | Networking: firewall |
| Troubleshoot networking | Networking: troubleshooting |
Community, FreeBSD and contributing¶
-
Community
— GitHub: https://github.com/kleene-project — IRC: #kleene on Libera Chat — Mastodon: post with the @kleene tag
-
Learn FreeBSD
-
Contribute