From e0db43db0131ffa82465c9d38bf0d615ba8afb5b Mon Sep 17 00:00:00 2001 From: Alexander Kiryukhin Date: Mon, 13 Dec 2021 16:08:21 +0300 Subject: [PATCH] Added docker --- Dockerfile | 12 ++++++++++++ README.md | 13 +++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..7b58a30 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +FROM golang:1.17-alpine as builder +WORKDIR /usr/src +COPY go.mod . +COPY go.sum . +RUN GOPROXY=${PROXY} go mod download +COPY . . +RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o pomodoro . + +FROM alpine +WORKDIR /usr/app +COPY --from=builder /usr/src/pomodoro . +CMD ["./pomodoro"] \ No newline at end of file diff --git a/README.md b/README.md index b6624e3..273523b 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,19 @@ Grab binaries for different OS from https://github.com/neonxp/pomodoro/releases brew install neonxp/tap/pomodoro ``` +### Docker + +Build image: + +```shell +docker build -t pomodoro . +``` + +Run image +```shell +docker run -it --rm pomodoro +``` + ### With golang ``` go install github.com/neonxp/pomodoro@latest