From 971d48f3d7b92a0d8c0dcc91e9bbd84fb29f085f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Mierzwa?= Date: Tue, 8 Aug 2017 16:22:41 -0700 Subject: [PATCH 1/2] 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. --- .dockerignore | 4 +--- Dockerfile | 14 +++++--------- 2 files changed, 6 insertions(+), 12 deletions(-) mode change 100644 => 120000 .dockerignore diff --git a/.dockerignore b/.dockerignore deleted file mode 100644 index aac74884e..000000000 --- a/.dockerignore +++ /dev/null @@ -1,3 +0,0 @@ -Dockerfile -Makefile -unsee diff --git a/.dockerignore b/.dockerignore new file mode 120000 index 000000000..3e4e48b0b --- /dev/null +++ b/.dockerignore @@ -0,0 +1 @@ +.gitignore \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 9bfb03c8f..cc4a73f46 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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"] From fe29b4b28b3db0b5e3557b106b147707694de60e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Mierzwa?= Date: Tue, 8 Aug 2017 16:30:25 -0700 Subject: [PATCH 2/2] Update docs to remove go install instructions --- README.md | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 0653746d0..402bb3608 100644 --- a/README.md +++ b/README.md @@ -45,17 +45,6 @@ used. ## Building and running -### Installing using the go command - -unsee is go installable, so the easiest way is to run: - - go install github.com/cloudflare/unsee - -The `unsee` binary will be installed into `$GOPATH/bin` directory. -Note that this will build the latest master version which might not work with -your Alertmanager version. See -[supported Alertmanager versions](#supported-alertmanager-versions). - ### Building from source To clone git repo and build the binary yourself run: @@ -67,6 +56,10 @@ To finally compile `unsee` the binary run: make +Note that building locally from sources requires Go, nodejs and npm. +See Docker build options below for instructions on building from withing docker +container. + ## Running `unsee` is configured via environment variables or command line flags.