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"] 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.