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 .