Build from docker broken
When I try to generate the docker image from the source, build fails.
- vxlan git version:
$ git log --decorate=full -1
commit 8750c0deead4e149e56023fb69716b0fb4948df4 (HEAD, tag: refs/tags/v0.7.1, refs/remotes/origin/master, refs/remotes/origin/HEAD, refs/heads/master)
- Build output:
$ docker build -t docker-vxlan-plugin .
Sending build context to Docker daemon 306.2 kB
Step 1/10 : FROM golang:1.5.4-wheezy
---> 46c0dd3402e9
Step 2/10 : MAINTAINER Clint Armstrong <[email protected]>
---> Using cache
---> 49b96dcaf190
Step 3/10 : ENV GO15VENDOREXPERIMENT 1
---> Using cache
---> 2bd3cef47508
Step 4/10 : RUN go get github.com/Masterminds/glide
---> Using cache
---> 9461e00a9a09
Step 5/10 : ENV SRC_ROOT /go/src/github.com/TrilliumIT/docker-vxlan-plugin
---> Using cache
---> 26c1db87350c
Step 6/10 : RUN mkdir -p ${SRC_ROOT}
---> Using cache
---> 4f607e1de1ac
Step 7/10 : WORKDIR ${SRC_ROOT}
---> Using cache
---> 8d27671a53cf
Step 8/10 : ADD . ${SRC_ROOT}/
---> 4356a7d6c0ea
Removing intermediate container d4f0988a2c52
Step 9/10 : RUN go get -t $($GOPATH/bin/glide novendor)
---> Running in 646281b6bddf
# github.com/docker/engine-api/client/transport
../../docker/engine-api/client/transport/tlsconfig_clone.go:10: c.Clone undefined (type *tls.Config has no field or method Clone)
The command '/bin/sh -c go get -t $($GOPATH/bin/glide novendor)' returned a non-zero code: 2
Use glide to install the correct versions of vendored dependancies before running a docker build.
go get github.com/Masterminds/glide
$GOPATH/bin/glide install
docker build -t docker-vxlan-plugin .
Right, that fixes the build. Why not running "glide install" in the Dockerfile? That would make builds reproducible whatever the host's contents.
Because glide makes use of a cache in ~/.glide/cache. Running glide install in the dockerfile would reclone all the vendored repositories directly from github every time you build instead of utilizing the cache.
Then, how does it build on docker hub, if your Dockerfile and repo don't bring all of their dependencies by themselves ?
It doesn't. The image on docker hub is not an automated build at this time.
OK. Then I guess make.sh should be the main build script? If you're OK with the idea, I can propose a patch so that it "glide installs" then performs a 2-stage Docker build. I'd make the version tests optional so it's easier to perform repetitive dev builds.
Does it sound good to you?
Sure.
Proposed changes in PR #3 .