Use make targets in the dockerfile

By dropping vendor & bindata.go from git unsee is no longer go installable, and realistically it won't be, because the build pipeline is big and involves multiple tools.
Let's just use make targets we use for development when building docker image.
This commit is contained in:
Łukasz Mierzwa
2017-08-08 16:22:41 -07:00
parent 016f54e63c
commit 971d48f3d7
2 changed files with 6 additions and 12 deletions

View File

@@ -1,3 +0,0 @@
Dockerfile
Makefile
unsee

1
.dockerignore Symbolic link
View File

@@ -0,0 +1 @@
.gitignore

View File

@@ -1,14 +1,10 @@
FROM golang:1.8.3-alpine
FROM golang:1.8.3-alpine as unsee-builder
COPY . /go/src/github.com/cloudflare/unsee
ARG VERSION
RUN apk add --update make git nodejs
RUN make -C /go/src/github.com/cloudflare/unsee VERSION="${VERSION:-dev}"
RUN go install \
-ldflags "-X main.version=${VERSION:-dev}" \
github.com/cloudflare/unsee && \
rm -fr /go/src
FROM golang:1.8.3-alpine
COPY --from=unsee-builder /go/src/github.com/cloudflare/unsee/unsee /bin/unsee
EXPOSE 8080
CMD ["unsee"]