• Stars
    star
    297
  • Rank 140,075 (Top 3 %)
  • Language
    Go
  • License
    MIT License
  • Created over 6 years ago
  • Updated over 5 years ago

Reviews

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

Repository Details

Run containers like a ross

boss

Build Status

ross

Disclaimer:

Posting the code publicly if others can find inspiration from it and to see how they can use containerd to build the container platform that they want. It's single node right now, no schedulers, you manage it on the node.

This code is open source and it should work for most setups on modern systems. If you don't have a modern system, then you are holding us all back and you need to upgrade. If you use a distro that lives in the past, maybe you should switch.

This project is built for me, for my servers, running the way I think infrastructure should run. It's very opinionated. I'll merge PRs when they make sense for the project, but if I don't merge your PR, don't take it personal. I need a place to try out ideas and only be responsible to myself, I write enough code that is used by many and feel the responsibility of my actions and code every day. This is my safe space where I only answer to myself.

Feel free to fork this project and make it something great for your own needs, I encourage it. Take the code, try out crazy ideas, experiment, and share your creations with others.

Warning:

When consul is enabled, boss will remove systemd-resolved because it causes so many issues with DNS and forwarding to consul to provide DNS and service discovery. The old fasion way of /etc/resolv.conf works much better without systemd poking with it.

CLI

NAME:
   boss - run containers like a ross

USAGE:
   boss [global options] command [command options] [arguments...]

VERSION:
   9

DESCRIPTION:


                    ___           ___           ___
     _____         /\  \         /\__\         /\__\
    /::\  \       /::\  \       /:/ _/_       /:/ _/_
   /:/\:\  \     /:/\:\  \     /:/ /\  \     /:/ /\  \
  /:/ /::\__\   /:/  \:\  \   /:/ /::\  \   /:/ /::\  \
 /:/_/:/\:|__| /:/__/ \:\__\ /:/_/:/\:\__\ /:/_/:/\:\__\
 \:\/:/ /:/  / \:\  \ /:/  / \:\/:/ /:/  / \:\/:/ /:/  /
  \::/_/:/  /   \:\  /:/  /   \::/ /:/  /   \::/ /:/  /
   \:\/:/  /     \:\/:/  /     \/_/:/  /     \/_/:/  /
    \::/  /       \::/  /        /:/  /        /:/  /
     \/__/         \/__/         \/__/         \/__/

run containers like a boss

COMMANDS:
     build     build
     create    create a container
     delete    delete a service
     init      init boss on a system
     kill      kill a running service
     list      list containers managed via boss
     rollback  rollback a container to a previous revision
     start     start an existing service
     stop      stop a running service
     update    update an existing container's configuration
     help, h   Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --help, -h     show help
   --version, -v  print the version

Ideas

  • you should be able to update container resources without restarting a container
  • you should be able to update the image without creating a new container
  • you should be able to rollback to a previous container state
  • containers should be able to migrate across nodes, live or otherwise, and keep all their data
  • services are automatically registered and found via DNS
  • don't bother me with fancy graphs and metrics, just alert me when something's wrong
  • logs on disk suck, apps should send to things like sentry when they can, else go to system logger
  • KISS

Dependencies

You need to have a new containerd version running. containerd 1.2+. As containerd 1.2 isn't out yet, use master, like me.

Also a modern systemd based system. Ubuntu 18.04 server works amazing. Boss needs to run as root.

System Configuration

To bootstrap your system write a system config to /etc/boss/boss.toml and run init your system with boss.

> boss init

This will install everything in your system config and get your system up and running. If you have consul configured, it will install, setup, configure DNS, and register other services automatically.

If you have cni configured, it will download the cni plugins and automatically use it for containers that have network = "cni" specified. You don't have to write a /etc/cni/net.d conf or install plugins, boss does it all for you.

If you want to be able to run boss build on a machine, you add the buildkit configuration and boss will get you buildkitd up and running and ready to build images.

There is other configurations that I use that are here. They may not be useful for other people, but again, this is my project built for me and my needs. I do what I want in it ;)

If you hate boss and think it's ugly, just run > boss init --undo and it will clean itself up and get out of your hair. EZ.

id = "hostname-01"
iface = "eth0"
domain = "my-domain"

[consul]
        image = "docker.io/crosbymichael/consul:latest"
        bootstrap = true

[buildkit]
        image = "docker.io/crosbymichael/buildkit:latest"

[cni]
        image = "docker.io/crosbymichael/cni:latest"
        type = "macvlan"
        [cni.ipam]
                type = "dhcp"

[nodemetrics]
        image = "docker.io/crosbymichael/nodeexporter:latest"

Container Configuration

To run a container, bootstrap your system then create a toml file and run it with boss.

> boss create redis.toml

id = "redis"
image = "docker.io/library/redis:3.2-stretch"
network = "cni"

[resources]
        memory = 1024
        cpu = 2.0

[services]
        [services.redis]
                port = 6379
                labels = ["dev"]

License

Copyright (c) 2018 Michael Crosby [email protected]

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use, copy,
modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH
THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

More Repositories

1

skydock

Service discovery via DNS for docker
Go
1,059
star
2

slex

SSH multiplex
Go
559
star
3

Dockerfiles

Collection of Dockerfiles
Python
299
star
4

dockersql

Query your docker via SQL
Go
122
star
5

docker-stress

Simple go stress test for docker
Go
107
star
6

proxy

Generic TCP/UDP proxy with awesome features
Go
66
star
7

.dotfiles

bootstrap for my dev setup
Vim Script
59
star
8

dockercon-2016

Code from my containerd talk
C
52
star
9

zkctl

Zookeeper CLI
Go
42
star
10

tracker

Go based bittorrent HTTP tracker
Go
26
star
11

crypt

Easy cross platform encryption and decryption
Go
26
star
12

thinkorswim

Thinkorswim C# Client using RTD
C#
25
star
13

firewall

Simple iptables based firewall
Go
23
star
14

ip-addr

Print the IP address for a given interface by name
Go
23
star
15

php-csv-to-xml-json

Online php script to convert csv files or links to csv files to xml and json
PHP
21
star
16

sentry-docker

Dockerfile for getsentry.com
Python
19
star
17

hooks

An application to manage webhooks
Go
19
star
18

dockerci

temp repo for docker ci service
Go
19
star
19

vim-cfmt

Vim plugin for automatic formatting of C source code
Vim Script
17
star
20

youtubedl-docker

Youtube downloader for docker
Shell
17
star
21

steamcmd-docker

Steam cmd for linux servers
Dockerfile
15
star
22

dolly

CSS
13
star
23

minecraft-docker

Minecraft dockerfile
9
star
24

butterfly-docker

Dockerfile for butterfly
Shell
9
star
25

gistit

Simple Go app to create gists on the command line
Go
8
star
26

ajenti-docker

Dockerfile for ajenti server monitor
Shell
7
star
27

fsharp-docker

f# dockerfile
Shell
7
star
28

mc-overviewer-docker

Minecraft overviewer dockerfile
7
star
29

messages

Simple message passing across processes or the world via redis
Go
7
star
30

tCal

Get your iCal events in terminal
Objective-C
6
star
31

rail

Prometheus UPS Exporter
Go
6
star
32

golang-docker

Go image base
Shell
6
star
33

rethinkdb-docker

Trusted build repository for Rethinkdb and docker
6
star
34

postgres-docker

Docker postgres
Shell
5
star
35

docker-hipache

Auto configure hipache routes with the docker events API
Go
5
star
36

pipelines-dockercon

Dockercon demo
Go
5
star
37

build-essential-docker

Gcc cpp build-essential libc
Shell
4
star
38

fm

CLI based file manager
Go
4
star
39

nginx-docker

Dockerfile for nginx
3
star
40

redis-docker

Redis dockerfile
Shell
3
star
41

htop-docker

Shell
3
star
42

dsh

the shell for the 2000nds
Go
3
star
43

python-docker

Dockerfile for python on debian
Shell
3
star
44

mvvm-async

.NET WPF MVVM Framework focused on asynchronous programming
C#
3
star
45

containerd-proxy

containerd system proxy
Go
3
star
46

teamspeak-docker

Shell
3
star
47

CocoaLinq

Linq for Objective - C
Objective-C
3
star
48

botbot

Discord bot package inspired by urfave/cli
Go
3
star
49

CMCoreNET

C#
2
star
50

htpasswd-docker

Docker repo for htpasswd
Shell
2
star
51

codeassistant

Run code snippets on windows
C#
2
star
52

java-docker

Java dockerfile base image
Shell
2
star
53

go-1.5-cbinding

Sample of making C link to Go functions
Go
2
star
54

ircstats

Go
2
star
55

feedparser

Go feedparser
Go
1
star
56

docker-link

Link into docker
Go
1
star
57

scout-docker

Scout realtime in a docker container
Shell
1
star
58

public

PSA
1
star
59

cloud9-docker

Dockerfile for cloud9 IDE
Shell
1
star
60

live-docker

Never die
Shell
1
star
61

shipyard-agent

Shipyard Agent
Go
1
star
62

RestfulMVC

C#
1
star
63

ipython-docker

Dockerfile for ipython with matplotlib, pandas, and numpy
Shell
1
star
64

securing-containers

Dockercon 2017 Talk
1
star
65

share

just a playground for tty websockets
Go
1
star
66

docker-qa

Go
1
star
67

monitor

Go
1
star
68

mono-docker

mono dockerfile
Shell
1
star