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
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
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()
You need Docker and then run
./script/build
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
Make sure you have a full Go 1.4 environment with godeps
godep go test ./...
This will be fully Dockerized in a bit
The project is still being kickstarted… But it does a lot. Please try it out and help us find bugs.
Want to hack on libcompose? Docker's contributions guidelines apply.