From 4672604cc0c261195b47b5796ac43194beca4d6e Mon Sep 17 00:00:00 2001 From: Martin Pizala Date: Fri, 18 May 2018 20:55:58 +0200 Subject: [PATCH] Dockerify dave --- .dockerignore | 1 + Dockerfile | 10 ++++++++++ Readme.md | 24 ++++++++++++++++++++++++ examples/config-sample.yaml | 2 +- 4 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 .dockerignore create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..1d085ca --- /dev/null +++ b/.dockerignore @@ -0,0 +1 @@ +** diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..134e6c7 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,10 @@ +FROM golang:alpine +RUN apk add --no-cache git +RUN go get -u github.com/micromata/dave/cmd/... + +FROM alpine:latest +RUN apk update && apk upgrade +RUN adduser -S dave +COPY --from=0 /go/bin/dave /usr/local/bin +USER dave +ENTRYPOINT ["/usr/local/bin/dave"] diff --git a/Readme.md b/Readme.md index 737d2c9..462075d 100644 --- a/Readme.md +++ b/Readme.md @@ -209,6 +209,30 @@ Now you can call `mage install` to build and install the binaries. If you just c install Installs dave and davecli to your $GOPATH/bin folder installDeps Runs dep ensure and installs additional dependencies. +### Build and run with Docker + +Building dave with Docker is simple + + git clone git@github.com:micromata/dave.git + cd dave + docker build -t dave . + +Let dave run + + # create webdav home + mkdir webdav-home + + docker run -d \ + -p 8000:8000 \ + -v $(pwd)/examples/config-sample.yaml:/config.yaml:ro \ + -v $(pwd)/webdav-home:/tmp:rw \ + dave + +To export the static binary simply run + + docker run --rm --entrypoint="" dave cat /usr/local/bin/dave > dave + chmod u+x dave + ## Connecting You could simply connect to the webdav server with a http(s) connection and a tool that allows the webdav protocol. diff --git a/examples/config-sample.yaml b/examples/config-sample.yaml index d4b2751..2c0f2d7 100644 --- a/examples/config-sample.yaml +++ b/examples/config-sample.yaml @@ -55,4 +55,4 @@ users: # create: false # read: false # update: false -# delete: falst +# delete: false