• Stars
    star
    209
  • Rank 187,261 (Top 4 %)
  • Language
    Go
  • License
    MIT License
  • Created almost 9 years ago
  • Updated almost 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

The super-simple chroot-based application container engine.

droot Latest Version Travis Build Status Go Report Card License

Droot is A simple chroot-based application container engine to build, ship, run with chroot instead of docker run. Droot 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. Then Droot provides a simpler container runtime without complicated stacks including linux namespaces and union filesystems like AUFS. It depends on simple Linux functions such as chroot(2), Linux capabilities(7) and a bind mount, and 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 architecture

Requirements

  • Docker (droot export 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/cmd/droot

Usage

$ docker build -t dockerfiles/app
$ droot export dockerfiles/app | gzip -cq | aws s3 cp - s3://drootexamples/app.tar.gz
$ sudo droot umount --root /var/containers/app # it is safe to umount before run if you use `--bind` option
$ mkdir -p /tmp/app /var/containers/app
$ aws s3 cp s3://drootexamples/app.tar.gz - | tar -xpzf - -C /tmp/app
$ mv -T /tmp/app /var/containers/app
$ sudo droot run --cp --user appuser --group appgroup --bind /var/log/app --root /var/containers/app -- command
$ sudo droot umount --root /var/containers/app

Integration with capze

https://github.com/yuuki/capze

$ aws s3 cp s3://drootexamples/app.tar.gz - | tar xzf - -C /tmp/app
$ capze --keep 5 /tmp/app /var/containers/app

How to set docker endpoint

Droot 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

Presentations (Japanese)

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

More Repositories

1

lstf

The aggregated TCP flows printer in Linux
Go
159
star
2

diamondb

[WIP] DiamonDB: Rebuild of time series database on AWS.
Go
103
star
3

shawk

[PoC] A socket-based tracing system for discovering network service dependencies. (renamed from transtracer)
Go
52
star
4

gokc

Yet Another Keepalived Syntax Checker in Golang.
Go
51
star
5

lsconntrack

The Linux netfilter conntrack-based connection flows pretty printer.
Go
41
star
6

yuuki-learned

What I learned.
34
star
7

go-conntracer-bpf

Go library using eBPF to trace network flow events
C
34
star
8

grabeni

Grabeni - An ops-friendly AWS Elastic Network Interface (ENI) attachment grabbing tool.
Go
21
star
9

capze

A tool to make Capistrano-based directory structure
Go
21
star
10

opstools

Tools for fast server operation
Perl
12
star
11

binrep

The static binary repository manager
Go
12
star
12

syscall-study

Linux system calls study
Rust
10
star
13

xtsdb

[PoC] Xtsdb: A scalable time series database on two tiers of Redis and Cassandra.
Go
9
star
14

Monitorel

A Web API providing server performance metrics graphs
CSS
6
star
15

dockerized-perl-app

How to dockerized perl web application
JavaScript
5
star
16

dotfiles

My dotfiles
Shell
5
star
17

mftracer

[WIP] A CLI visualizer for distributed dependency graph by TCP port tracing
Go
5
star
18

WebService-Qiita

Perl wrapper for Qiita API
Perl
4
star
19

perl-local-lib-path.vim

perl-local-lib-path is a helper for vim path
Vim Script
4
star
20

redis-cluster-tutorial

Playground for Redis cluster tutorial
Ruby
4
star
21

cfstacker

A simple AWS CloudFormation stacks manager
Python
3
star
22

mkr-check

A CLI to run check commands in mackerel-agent.conf.
Go
2
star
23

dockerfiles

My dockerfiles
Dockerfile
2
star
24

bootstrap

Bootstrap script for clean OS to feel better
Shell
2
star
25

ansible-operation-helper

Shell
2
star
26

paper-tex-en-boilerplate

The template for writing English paper in Tex.
TeX
2
star
27

albio

albio: A CLI tool to gracefully manage EC2 instances with ALB/NLB
Go
1
star
28

yuuki

yuuki's GitHub profile
1
star
29

Coteng

Coteng - Lightweight Teng
Perl
1
star
30

p5-RRD-Rawish

A RRDtool wrapper with rawish interface in Perl
Perl
1
star
31

mackerel2route53

[WIP] Internal DNS on Route53 based on mackerel.io
Go
1
star
32

isucon5-qualifier

はむちゃん
Perl
1
star
33

cookwares

Go
1
star
34

connperf

Network connections generator in Go.
Go
1
star
35

shawk-experiments

Go
1
star
36

blog.yuuk.io

http://blog.yuuk.io
Makefile
1
star
37

rlq

[WIP]
Rust
1
star
38

pgmonit

A web-based Postgres statistics monitor
Go
1
star
39

unite-perl-module.vim

Perl module source for unite.vim
Vim Script
1
star
40

syntastic-local-lib-path.vim

A plugin for syntastic to add local lib path such as local/lib/perl5.
Vim Script
1
star