a container tool that's more dank
Latest commit e2ba273 Jan 9, 2017 @myfreeweb stuff
Failed to load latest commit information.




Danker is a really simple container tool for FreeBSD (Linux support coming soon).

  • Just a tiny Ruby script with no gem dependencies!
  • No daemon, no client-server API, contained programs run in the foreground.
  • No centralized hub to pull built images from.
  • ABI-aware (e.g. runs Linux containers on FreeBSD).

Danker lets you build containers, run commands within them, and pack them into archives (excluding unnecessary files!) for running with plain jail/chroot/etc. commands in a production environment. Also it can trace open files inside of the container using DTrace - to help with the "excluding unnecessary files" part.

Building is the most important part here. Danker will download files, check their hashes, extract them and run a setup script inside of the container. A container can inherit everything from a parent container (using the from property). Union mounts are used for that.

Downloads are cached in a content-addressable (hash-based) store, so if you've already downloaded a file with a particular hash, it won't be redownloaded. (Even if you specify a sha1 hash and you previously specified a sha256 one!)

Built containers' filesystem overlays are stored in a similar way, each one is named with the hash of the parameters used to build it (downloads, setup script, parent container). If something changed that's not included in that list (e.g. a remote package you download in the setup script), you can do a force rebuild with the -F flag.

So, a Dankfile.yaml looks like this:

  abi: { os: freebsd, version: 11.0-RELEASE, cpu: amd64 }
    - from: http://ftp.freebsd.org/pub/FreeBSD/releases/amd64/11.0-RELEASE/base.txz
      hash: sha256:bb80ededf207c48122434833b83110225b798fb31273051fcb64316ff782c1ef
      extract: true
      to: / # path inside of the container
  setup: |
    env ASSUME_ALWAYS_YES=YES pkg bootstrap

  from: freebsd-11.0
    - from: . # path is relative to the Dankfile itself
      to: /app # path inside of the container
  setup: |
    env ASSUME_ALWAYS_YES=YES pkg install python36
    serve: |
      cd /app
      python3.6 app.py serve
    include: |
    exclude: |

In that example, you can run the serve script with:

sudo danker -c my-app run serve


  • Unmount on interrupt signal
  • Preserve exit code from the jail command
  • Force rebuild only last container in inheritance chain
  • Garbage collection for built overlays
  • Include dankfiles
  • Running on Linux (unshare + chroot)
  • Optional networking settings (cmdline args / env)
  • Optional resource limits (same)


Please feel free to submit pull requests!

By participating in this project you agree to follow the Contributor Code of Conduct.


This is free and unencumbered software released into the public domain.
For more information, please refer to the UNLICENSE file or unlicense.org.