Skip to content
This repository has been archived by the owner on Jun 16, 2021. It is now read-only.

Unable to build libcompose #442

Open
procrypt opened this issue Feb 23, 2017 · 2 comments
Open

Unable to build libcompose #442

procrypt opened this issue Feb 23, 2017 · 2 comments

Comments

@procrypt
Copy link

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
Copy link
Contributor

vito-c commented Feb 23, 2017

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)
    }
}

@procrypt
Copy link
Author

procrypt commented Mar 2, 2017

@vito-c can you be more verbose :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants