From bf71ef036decd1eb5f5ca633b645db50954396d6 Mon Sep 17 00:00:00 2001 From: Yuce Tekol Date: Sat, 4 Feb 2017 13:00:21 +0300 Subject: [PATCH] Added build container --- .dockerignore | 1 + Dockerfile | 13 ++++++++----- Makefile | 2 +- 3 files changed, 10 insertions(+), 6 deletions(-) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 000000000..9abb766ce --- /dev/null +++ b/.dockerignore @@ -0,0 +1 @@ +.* \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index c57449ac9..257bdcd86 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,14 @@ -FROM scratch +FROM golang:1.7.5 -MAINTAINER Pilosa Corp. +MAINTAINER Pilosa Corp. -ENV DATA_DIR /data EXPOSE 15000 VOLUME /data -COPY ./pilosa /pilosa +RUN echo 'data-dir = "/data"' > /config -ENTRYPOINT ["/pilosa"] +COPY . /go/src/github.com/pilosa/pilosa +RUN CGO_ENABLED=0 go install -a github.com/pilosa/pilosa/cmd/pilosa + +ENTRYPOINT ["/go/bin/pilosa"] +CMD ["-config", "/config"] diff --git a/Makefile b/Makefile index 986c735da..61abf2026 100644 --- a/Makefile +++ b/Makefile @@ -7,4 +7,4 @@ vendor: cp -r $(GOPATH)/src/github.com/gogo/protobuf/proto/testdata vendor/github.com/gogo/protobuf/proto/testdata docker: - CGO_ENABLED=0 go build github.com/pilosa/pilosa/cmd/pilosa && docker build -t pilosa:latest . + docker build -t pilosa:latest .