Add docker multiarch build and push to release

Co-authored-by: Ben Johnson <benbjohnson@yahoo.com>
This commit is contained in:
Campbell Vertesi
2022-02-11 15:37:26 +01:00
committed by Ben Johnson
parent 8589111717
commit 1a630aed04
3 changed files with 62 additions and 3 deletions

View File

@@ -1,11 +1,15 @@
FROM golang:1.16 as builder
FROM golang:1.17 as builder
WORKDIR /src/litestream
COPY . .
ARG LITESTREAM_VERSION=latest
RUN --mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/go/pkg \
go build -ldflags "-s -w -X 'main.Version=${LITESTREAM_VERSION}' -extldflags '-static'" -tags osusergo,netgo,sqlite_omit_load_extension -o /usr/local/bin/litestream ./cmd/litestream
FROM alpine
COPY --from=builder /usr/local/bin/litestream /usr/local/bin/litestream
ENTRYPOINT ["/usr/local/bin/litestream"]