Unable to build libcompose
procrypt opened this issue · 2 comments
procrypt commented
I was trying to build libcompose
binary but, when I run go build -o libcompose ./cli/main
, this pops up
# github.com/libcompose/cli/main
cli/main/main.go:50: cannot use "github.com/docker/libcompose/cli/app".BeforeApp (type func(*"github.com/docker/libcompose/vendor/github.com/urfave/cli".Context) error) as type "github.com/libcompose/vendor/github.com/urfave/cli".BeforeFunc in assignment
cli/main/main.go:51: cannot use append(command.CommonFlags(), "github.com/docker/libcompose/cli/docker/app".DockerClientFlags()...) (type []"github.com/docker/libcompose/vendor/github.com/urfave/cli".Flag) as type []"github.com/libcompose/vendor/github.com/urfave/cli".Flag in assignment
cli/main/main.go:53: cannot use command.BuildCommand(factory) (type "github.com/docker/libcompose/vendor/github.com/urfave/cli".Command) as type "github.com/libcompose/vendor/github.com/urfave/cli".Command in array or slice literal
cli/main/main.go:54: cannot use command.ConfigCommand(factory) (type "github.com/docker/libcompose/vendor/github.com/urfave/cli".Command) as type "github.com/libcompose/vendor/github.com/urfave/cli".Command in array or slice literal
cli/main/main.go:55: cannot use command.CreateCommand(factory) (type "github.com/docker/libcompose/vendor/github.com/urfave/cli".Command) as type "github.com/libcompose/vendor/github.com/urfave/cli".Command in array or slice literal
cli/main/main.go:56: cannot use command.EventsCommand(factory) (type "github.com/docker/libcompose/vendor/github.com/urfave/cli".Command) as type "github.com/libcompose/vendor/github.com/urfave/cli".Command in array or slice literal
cli/main/main.go:57: cannot use command.DownCommand(factory) (type "github.com/docker/libcompose/vendor/github.com/urfave/cli".Command) as type "github.com/libcompose/vendor/github.com/urfave/cli".Command in array or slice literal
cli/main/main.go:58: cannot use command.KillCommand(factory) (type "github.com/docker/libcompose/vendor/github.com/urfave/cli".Command) as type "github.com/libcompose/vendor/github.com/urfave/cli".Command in array or slice literal
cli/main/main.go:59: cannot use command.LogsCommand(factory) (type "github.com/docker/libcompose/vendor/github.com/urfave/cli".Command) as type "github.com/libcompose/vendor/github.com/urfave/cli".Command in array or slice literal
cli/main/main.go:60: cannot use command.PauseCommand(factory) (type "github.com/docker/libcompose/vendor/github.com/urfave/cli".Command) as type "github.com/libcompose/vendor/github.com/urfave/cli".Command in array or slice literal
cli/main/main.go:60: too many errors
Go Version
go version go1.7.1 linux/amd64
Can anyone help ?
vito-c commented
Try this from the readme first
package main
import (
"log"
"golang.org/x/net/context"
"github.com/docker/libcompose/docker"
"github.com/docker/libcompose/docker/ctx"
"github.com/docker/libcompose/project"
"github.com/docker/libcompose/project/options"
)
func main() {
project, err := docker.NewProject(&ctx.Context{
Context: project.Context{
ComposeFiles: []string{"docker-compose.yml"},
ProjectName: "my-compose",
},
}, nil)
if err != nil {
log.Fatal(err)
}
err = project.Up(context.Background(), options.Up{})
if err != nil {
log.Fatal(err)
}
}