From c7a0aa371d457f580e9d5ba07a342cb44eef1d55 Mon Sep 17 00:00:00 2001 From: Yuce Tekol Date: Mon, 20 Feb 2017 20:11:58 +0300 Subject: [PATCH 1/2] Installs glide in the docker container --- Dockerfile | 14 +++++++++++++- Makefile | 2 +- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 257bdcd86..07e13620f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,8 +7,20 @@ VOLUME /data RUN echo 'data-dir = "/data"' > /config +RUN git clone --depth 1 https://github.com/Masterminds/glide.git /go/src/github.com/Masterminds/glide \ + && cd /go/src/github.com/Masterminds/glide \ + && git fetch --tags --depth 1 \ + && git checkout tags/v0.12.3 -b build \ + && make build \ + && mv ./glide /go/bin \ + && cd / \ + && rm -r /go/src/github.com/Masterminds/glide + COPY . /go/src/github.com/pilosa/pilosa -RUN CGO_ENABLED=0 go install -a github.com/pilosa/pilosa/cmd/pilosa + +RUN cd /go/src/github.com/pilosa/pilosa \ + && make vendor \ + && 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 09b5616be..f55fb8445 100644 --- a/Makefile +++ b/Makefile @@ -43,5 +43,5 @@ install: vendor go install $(LDFLAGS) $(FLAGS) $(CLONE_URL)/cmd/pilosa go install $(LDFLAGS) $(FLAGS) $(CLONE_URL)/cmd/pilosactl -docker: vendor +docker: docker build -t pilosa:latest . From c2afa6491da31abdafba54a995a32307fa7c6c58 Mon Sep 17 00:00:00 2001 From: Yuce Tekol Date: Tue, 21 Feb 2017 23:08:41 +0300 Subject: [PATCH 2/2] Updated README for docker usage --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index 2079010ec..19221e003 100644 --- a/README.md +++ b/README.md @@ -65,6 +65,20 @@ The remaining configuration options should be the same on every node in the clus `[[cluster.node]]`: specifies each node within the cluster +## Docker + +You can create a Pilosa container using `make docker` or equivalently: +``` +docker build -t pilosa:latest . +``` + +You can run a temporary container using: +``` +docker run -it --rm --name pilosa -p 15000:15000 pilosa:latest +``` + +When you click `Ctrl+C` to stop the container, the container and the data in the container will be erased. You can leave out `--rm` flag to keep the data in the container. See [Docker documentation](https://docs.docker.com) for other options. + ## Usage You can interact with Pilosa via HTTP requests to the host:port on which you have Pilosa running.