今天编译agent时,发现报如下错误
make
go build -buildmode=pie -tags "" -o kata-agent \
-ldflags "-X main.version=1.9.0-rc0-ba6ab83c16cc3df8d188118e1555ba66958f6a87 -X main.seccompSupport=no "
unexpected directory layout:
import path: github.com/docker/docker/pkg/parsers
root: /root/golang/src
dir: /root/golang/src/github.com/kata-containers/agent/vendor/github.com/docker/docker/pkg/parsers
expand root: /root/golang/src
expand dir: /root/golang/src/github.com/kata-containers/agent/vendor/github.com/docker/docker/pkg/parsers
separator: /
make: *** [kata-agent] Error 1
原因是之前修改了go的环境变量export PATH="$PATH:$GOROOT/bin:$GOPATH:$GOPATH/go/bin"
解决办法修改/etc/profile
#go env
export GOROOT=/usr/local/go
export GOPATH=/root/golang
export PATH="$PATH:$GOROOT/bin"