docker-vxlan-plugin icon indicating copy to clipboard operation
docker-vxlan-plugin copied to clipboard

Build from docker broken

Open hervenicol opened this issue 8 years ago • 8 comments

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

hervenicol avatar Feb 03 '17 09:02 hervenicol

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 .

clinta avatar Feb 03 '17 13:02 clinta

Right, that fixes the build. Why not running "glide install" in the Dockerfile? That would make builds reproducible whatever the host's contents.

hervenicol avatar Feb 03 '17 14:02 hervenicol

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.

clinta avatar Feb 03 '17 14:02 clinta

Then, how does it build on docker hub, if your Dockerfile and repo don't bring all of their dependencies by themselves ?

hervenicol avatar Feb 03 '17 14:02 hervenicol

It doesn't. The image on docker hub is not an automated build at this time.

clinta avatar Feb 03 '17 14:02 clinta

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?

hervenicol avatar Feb 03 '17 14:02 hervenicol

Sure.

clinta avatar Feb 03 '17 14:02 clinta

Proposed changes in PR #3 .

hervenicol avatar Feb 06 '17 10:02 hervenicol