github.com/bdwilliams/libcompose@v0.3.1-0.20160826154243-d81a9bdacff0/example/main.go (about) 1 package main 2 3 import ( 4 "log" 5 6 "golang.org/x/net/context" 7 8 "github.com/docker/libcompose/docker" 9 "github.com/docker/libcompose/project" 10 "github.com/docker/libcompose/project/options" 11 ) 12 13 func main() { 14 project, err := docker.NewProject(&docker.Context{ 15 Context: project.Context{ 16 ComposeFiles: []string{"docker-compose.yml"}, 17 ProjectName: "yeah-compose", 18 }, 19 }, nil) 20 21 if err != nil { 22 log.Fatal(err) 23 } 24 25 err = project.Up(context.Background(), options.Up{}) 26 27 if err != nil { 28 log.Fatal(err) 29 } 30 }