• Stars
    star
    173
  • Rank 213,140 (Top 5 %)
  • Language
    Go
  • License
    MIT License
  • Created about 7 years ago
  • Updated about 1 year ago

Reviews

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

Repository Details

faster, drop in, alternative to docker-compose

meli

ci codecov GoDoc Go Report Card

Meli is supposed to be a faster, and drop in, alternative to docker-compose. Faster in the sense that, Meli will try to pull as many services(docker containers) as it can in parallel.

Meli is a Swahili word meaning ship; so think of Meli as a ship carrying your docker containers safely across the treacherous container seas.

It's currently work in progress, API will remain unstable for sometime.

I only intend to support docker-compose version 3+

Meli is NOT intended to replicate every feature of docker-compose, it is primarily intended to enable you to pull, build and run the services in your docker-compose file as fast as possible.
If you want to exec in to a running container, use docker; if you want to run an adhoc command in a container, use docker; if you want..... you get the drift.

Installing/Upgrading

Download a binary release for your particular OS from the releases page
We have binaries for:

  • linux(64bit)
  • windows(64bit)
  • macOS(64bit)

Usage

meli --help

Usage of meli:
  -up
    	Builds, re/creates, starts, and attaches to containers for a service.
        -d option runs containers in the background
  -f string
    	path to docker-compose.yml file. (default "docker-compose.yml")
  -build
    	Rebuild services
  -v	Show version information.
  -version
    	Show version information.

cat docker-compose.yml

version: '3'
services:
  redis:
    image: 'redis:3.0-alpine'
    environment:
      - RACK_ENV=development
      - type=database
    ports:
      - "6300:6379"
      - "6400:22"

meli -up

redis :: Pulling from library/redis 
redis :: Pulling fs layer 
redis :: Pulling fs layer 
redis :: Downloading [======================>        ]  3.595kB/8.164kB
redis :: Downloading [==============================>]  8.164kB/8.164kB
redis :: Download complete [========================>]  8.164kB/8.164kB
redis :: The server is now ready to accept connections on port 6379

Usage as a library

You really should be using the official docker Go sdk
However, if you feel inclined to use meli;

package main

import (
	"context"
	"log"
	"os"

	"github.com/docker/docker/client"
	"github.com/komuw/meli"
)

func main() {
	dc := &meli.DockerContainer{
		ComposeService: meli.ComposeService{Image: "busybox"},
		LogMedium:      os.Stdout,
		FollowLogs:     true}

	ctx := context.Background()
	cli, err := client.NewEnvClient()
	if err != nil {
		log.Fatal(err, " :unable to intialize docker client")
	}
	defer cli.Close()

	meli.LoadAuth() // load dockerhub info
	err = meli.PullDockerImage(ctx, cli, dc)
	log.Println(err)

}

Benchmarks

Aaah, everyones' favorite vanity metric yet no one seems to know how to conduct one in a consistent and scientific manner.
Take any results you see here with a large spoon of salt; They are unscientific and reek of all that is wrong with most developer benchmarks.

Having made that disclaimer,

Benchmark test:
this docker-compose file

Benchmark script:
for docker-compose:
docker ps -aq | xargs docker rm -f; docker system prune -af; /usr/bin/time -apv docker-compose up -d
for meli:
docker ps -aq | xargs docker rm -f; docker system prune -af; /usr/bin/time -apv meli -up -d

Benchmark results(average):

tool Elapsed wall clock time(seconds)
docker-compose 10.411 seconds
meli 3.945 seconds

Thus, meli appears to be 2.6 times faster than docker-compose(by wall clock time).
You can checkout the current benchmark results from circleCI
However, I'm not making a tool to take docker-compose to the races.

Development

Build

git clone [email protected]:komuw/meli.git
go build -trimpath -o meli cli/cli.go
./meli -up -f /path/to/docker-compose-file.yml

TODO

  • add better documentation(godoc)
  • stabilise API(maybe)

More Repositories

1

sewer

Let's Encrypt(ACME) client. Python library & CLI app.
Python
145
star
2

komu.engineer

personal website/blog
HTML
40
star
3

naz

naz is an async SMPP client.
Python
38
star
4

ote

ote updates a packages' go.mod file with a comment next to all dependencies that are test dependencies; identifying them as such.
Go
34
star
5

kshaka

Kshaka is a Go implementation of the CASPaxos consensus protocol.
Go
24
star
6

ong

ong, is a Go http toolkit.
Go
15
star
7

sir

Sir, is a tcp proxy that checks for regressions in your services/apps.
Go
12
star
8

smpp_server_docker

docker image for SMPP simulator from http://www.seleniumsoftware.com/
Java
11
star
9

otero

Go
9
star
10

casPaxos

prototype implementation of CASPaxos consenus algorithm
Python
8
star
11

goproxy

a disk based GOPROXY for modules
Shell
5
star
12

wiji

Wiji is an asyncio distributed task processor/queue.
Python
4
star
13

smpplib2

Python
4
star
14

yuyuid

Golang uuid library
Go
3
star
15

hardstone

hardstone, auto creates a development environment and provisions it. The only manual thing you need to do is get a mug of coffee.
Nix
3
star
16

safcom_b2c_code_sample

Python
2
star
17

zakah

Zakah is a client library for safaricom's Mpesa API.
Dart
2
star
18

kama

kama prints exported information of types, variables, packages, modules, imports etc. It also pretty prints data structures. It can be used to aid debugging and testing.
Go
2
star
19

shifta

Go
1
star
20

odesk-elance-python-answers

These are answers to some of the questions that elance and/or odesk ask when you take their python test. they are not ordered in any manner.
1
star
21

tyk-playground

Shell
1
star
22

uptime-checker

Python
1
star
23

docker_chromebook

Use docker inside crouton on a Chromebook
JavaScript
1
star
24

django-api-lambda

run django apps on AWS lambda
Python
1
star
25

smpp_server

Python
1
star
26

celery_experiments

various experiments with celery
Python
1
star
27

docker-kannel

repository for docker images of Kannel, which is an open source WAP and SMS gateway.
Shell
1
star