brandonweeks/vsphere_exporter

docker build fails

MattMencel opened this issue · 1 comments

I'm pretty new to this so I may just be doing it wrong. However...I get an error when trying to build.

Go and Docker versions:

$ go version
go version go1.8.3 darwin/amd64

$ docker version
Client:
 Version:      17.05.0-ce
 API version:  1.24 (downgraded from 1.29)
 Go version:   go1.8.1
 Git commit:   89658be
 Built:
 OS/Arch:      darwin/amd64

Server:
 Version:      1.12.3
 API version:  1.24 (minimum version )
 Go version:   go1.6.3
 Git commit:   6b644ec
 Built:        Wed Oct 26 23:26:11 2016
 OS/Arch:      linux/amd64
 Experimental: false
$ docker build .
Sending build context to Docker daemon  124.4kB
Step 1 : FROM golang:1.6-onbuild
1.6-onbuild: Pulling from library/golang
5040bd298390: Pull complete
fce5728aad85: Pull complete
76610ec20bf5: Pull complete
86b681f75ff6: Pull complete
77855d2f51f6: Pull complete
b989296b493d: Pull complete
2d403c19702e: Pull complete
d34839605e09: Pull complete
Digest: sha256:5307f272434d6fff934b0976d6b4c55e46792b100bfb4c66b9b9f16deca8b32f
Status: Downloaded newer image for golang:1.6-onbuild
# Executing 3 build triggers...
Step 1 : COPY . /go/src/app
Step 1 : RUN go-wrapper download
 ---> Running in 144cf0340215
+ exec go get -v -d
github.com/prometheus/client_golang (download)
github.com/beorn7/perks (download)
github.com/golang/protobuf (download)
github.com/prometheus/client_model (download)
github.com/prometheus/common (download)
github.com/matttproud/golang_protobuf_extensions (download)
github.com/prometheus/procfs (download)
github.com/prometheus/log (download)
github.com/Sirupsen/logrus (download)
github.com/serenize/snaker (download)
github.com/vmware/govmomi (download)
package context: unrecognized import path "context" (import path does not begin with hostname)
Fetching https://golang.org/x/net/context?go-get=1
Parsing meta tags from https://golang.org/x/net/context?go-get=1 (status code 200)
get "golang.org/x/net/context": found meta tag main.metaImport{Prefix:"golang.org/x/net", VCS:"git", RepoRoot:"https://go.googlesource.com/net"} at https://golang.org/x/net/context?go-get=1
get "golang.org/x/net/context": verifying non-authoritative meta tag
Fetching https://golang.org/x/net?go-get=1
Parsing meta tags from https://golang.org/x/net?go-get=1 (status code 200)
golang.org/x/net (download)
Fetching https://gopkg.in/yaml.v2?go-get=1
Parsing meta tags from https://gopkg.in/yaml.v2?go-get=1 (status code 200)
get "gopkg.in/yaml.v2": found meta tag main.metaImport{Prefix:"gopkg.in/yaml.v2", VCS:"git", RepoRoot:"https://gopkg.in/yaml.v2"} at https://gopkg.in/yaml.v2?go-get=1
gopkg.in/yaml.v2 (download)
The command '/bin/sh -c go-wrapper download' returned a non-zero code: 1

It looks like govmomi has started using the new context package introduced into Go 1.7. Bumping the Go 1.8 version fixes the Docker build, let me know how it works for you!