Droot - A super-easy container engine with chroot without docker.
Go Shell Makefile
Latest commit 3e9eed3 Jun 18, 2016 @yuuki Bump version 0.6.2

README.md

droot Latest Version Travis Build Status Go Report Card License

Droot is a super-easy container to build, ship, run with chroot instead of docker run. It aims to simply escape dependency hell.

Overview

Docker has a powerful concept about an application deployment process, that is Build, Ship, Run. But there are many cases that docker runtime is too complicated and beyond our current capabilities, especially on production.

Droot provides a simpler container runtime without annoying Linux Namespaces. Droot depends on traditional Linux functions such as chroot(2), Linux capabilities(7) and a bind mount. droot helps you to chroot a container image built by docker and to import/export container images on Amazon S3.

  • Build: Build archives by docker build and docker export
  • Ship: Upload the archives to a storage (like Amazon S3), and Download archives from it.
  • Run: chroot(2), Linux capabilities(7), and a bind mount.

droot concept

Requirements

  • Docker (droot push only depends on it)
  • Linux (droot run and droot umount only supports it)

Installation

Homebrew

$ brew tap yuuki/droot
$ brew install droot

Download binary from GitHub Releases

Releases・yuuki/droot - GitHub

Build from source

 $ go get github.com/yuuki/droot
 $ go install github.com/yuuki/droot/cmd

Usage

$ docker build -t dockerfiles/app
$ droot export dockerfiles/app | gzip -cq | aws s3 cp - s3://drootexamples/app.tar.gz
$ aws s3 cp s3://drootexamples/app.tar.gz - | gunzip -cq | droot deploy --root /var/containers/app
$ sudo droot run --cp --bind /var/log --root /var/containers/app -- command
$ sudo droot umount --root /var/containers/app
$ sudo droot rm --root /var/containers/app

How to set docker endpoint

Droot push supports the environment variables same as docker-machine such as DOCKER_HOST, DOCKER_TLS_VERIFY, DOCKER_CERT_PATH. ex.

DOCKER_TLS_VERIFY=1
DOCKER_HOST=tcp://192.168.x.x:2376
DOCKER_CERT_PATH=/home/yuuki/.docker/machine/machines/dev

Roodmap

  • pull command with the rsync option
  • push/pull other compression algorithms
  • pull from docker registry
  • push/pull S3 download/upload part-size options
  • push/pull verifying sha256sum
  • pull backup/rollback option

Development

Droot uses a package using cgo, so it is necessary to build in Linux for a Linux binary. It is recommanded to use Docker for development if you are on OSX and other OSs.

build in Docker container

$ ./script/build_in_container.sh make build

Contribution

  1. Fork (https://github.com/yuuki/droot/fork)
  2. Create a feature branch
  3. Commit your changes
  4. Rebase your local changes against the master branch
  5. Run test suite with the make test command and confirm that it passes
  6. Create a new Pull Request

Author

y_uuki