dongshi6969
2018-09-09 18:18 阅读 219

我如何才能适当地供应商github.com/docker/docker?

here my main.go

package cmd

import (
    "context"
    "fmt"

    "github.com/docker/docker/api/types"
    "github.com/docker/docker/client"
)

func main() {
    cli, err := client.NewClientWithOpts(client.WithVersion("1.38"))
    if err != nil {
        panic(err)
    }

    networks, err := cli.NetworkList(context.Background(), types.NetworkListOptions{})
    if err != nil {
        panic(err)
    }
    fmt.Println(networks)
}

i tried to run dep init but vendor folder ended up with an older version of docker/docker because the newest tag is 17.05 tried to pin the actual commit but that did not work either

i give a shot to go mod vendor but that also rely on git tags

Strangely enough docker/docker is an alias to moby/moby and docker/engine.

Anyone could explain me and give example how can i successfully use vendoring with docker API?

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

1条回答 默认 最新

  • 已采纳
    dongzhuang6247 dongzhuang6247 2018-09-09 19:43
    [[constraint]]
      name = "github.com/docker/docker"
      branch = "master"
    
    [[override]]
      name = "github.com/docker/distribution"
      branch = "master"
    

    Actually this two entries helped solve the dependency issue in Gopkg.toml, then running dep ensure

    点赞 评论 复制链接分享

相关推荐