From ffcfb00205da8976666160b72f88b21ee09b1897 Mon Sep 17 00:00:00 2001 From: Vadim Iskuchekov Date: Wed, 30 Oct 2019 13:01:00 +1000 Subject: [PATCH] Dockerfile, dockerignore, README update --- .dockerignore | 5 +++++ Dockerfile | 10 ++++++++++ README.md | 6 ++++++ 3 files changed, 21 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..6adf8ab --- /dev/null +++ b/.dockerignore @@ -0,0 +1,5 @@ +* +!app +!vendor +!go.mod +!go.sum diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..f885c4f --- /dev/null +++ b/Dockerfile @@ -0,0 +1,10 @@ +FROM golang:1.13.3-alpine3.10 as builder +ADD . /build +WORKDIR /build +RUN GO111MODULE=on CGO_ENABLED=0 go build -mod=vendor -o underblog ./app/main.go + +FROM scratch +COPY --from=builder /build/underblog /app/underblog +ENV PATH "/app:${PATH}" +WORKDIR /blog +CMD ["underblog"] \ No newline at end of file diff --git a/README.md b/README.md index cfab53a..aa72a43 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,12 @@ On MacOS: brew install freetonik/tap/underblog ``` +Docker: + +``` +docker run --rm -it -v /path/to/your/blog:/blog freetonik/underblog +``` + Other platforms: coming soon. Or you can build yourself by cloning the repo and running `make build`. ## How it works