rancher/libcompose

Name: libcompose

Owner: Rancher

Description: null

Created: 2015-08-13 18:34:11.0

Updated: 2015-08-13 18:34:12.0

Pushed: 2018-05-20 02:13:16.0

Homepage: null

Size: 3647

Language: Go

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

libcompose

A Go library for Docker Compose. It does everything the command-line tool does, but from within Go – read Compose files, start them, scale them, etc.

Note: This is experimental and not intended to replace the Docker Compose command-line tool. If you're looking to use Compose, head over to the Compose installation instructions to get started with it.

age main

rt (
"log"

"github.com/docker/libcompose/docker"
"github.com/docker/libcompose/project"


 main() {
project, err := docker.NewProject(&docker.Context{
    Context: project.Context{
        ComposeFile: "docker-compose.yml",
        ProjectName: "my-compose",
    },
})

if err != nil {
    log.Fatal(err)
}

project.Up()

Building

You need Docker and then run

./script/build
Running

A partial implementation of the docker-compose CLI is also implemented in Go. The primary purpose of this code is so one can easily test the behavior of libcompose.

Run one of these:

ompose-cli_darwin-386
ompose-cli_linux-amd64
ompose-cli_windows-amd64.exe
ompose-cli_darwin-amd64
ompose-cli_linux-arm
ompose-cli_linux-386
ompose-cli_windows-386.exe
Tests

Make sure you have a full Go 1.4 environment with godeps

godep go test ./...

This will be fully Dockerized in a bit

Current status

The project is still being kickstarted… But it does a lot. Please try it out and help us find bugs.

Contributing

Want to hack on libcompose? Docker's contributions guidelines apply.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.