使用Docker的libcontainer存在导入问题。

huangapple go评论104阅读模式
英文:

Import issue with docker's libcontainer

问题

当使用Docker的libcontainer(特别是网络部分)时,在构建项目时使用go build时,我遇到了一个undefined错误。

import (
    "encoding/json"
    ...
    "github.com/docker/libcontainer/network"
)

func SetIP(a Address) (err error) {
   ...
   err = network.SetInterfaceIp(a.Link, a.IP)
   ....
}

错误本身是:

./addresses.go:170: undefined: network.SetInterfaceIp

我已经在库中检查过,我可以找到这个所谓的函数。

英文:

When using the docker's libcontainer (specifically the network part), I get an undefined error while building using go build on my project.

import (
    "encoding/json"
    ...
    "github.com/docker/libcontainer/network"
)

func SetIP(a Address) (err error) {
   ...
   err = network.SetInterfaceIp(a.Link, a.IP)
   ....
}

The error itself:

./addresses.go:170: undefined: network.SetInterfaceIp

I've checked inside the library itself and I can find this so called function.

答案1

得分: 1

我正在使用OSX进行构建,但使用libcontainer时无法完成。在使用Debian虚拟机后,整个项目成功构建。

向@JimB和@Not_a_Golfer表示赞赏,感谢他们的提示。

英文:

I was building on OSX, which cannot be done when using libcontainer. After using a debian VM the whole project was built correctly.

Kudos to @JimB and @Not_a_Golfer for the hints.

huangapple
  • 本文由 发表于 2014年12月10日 04:23:29
  • 转载请务必保留本文链接:https://go.coder-hub.com/27388122.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定