You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

23 lines
641 B

FROM golang:1.15-alpine as backend
RUN apk add --no-cache git gcc musl-dev
RUN go get
RUN go get
COPY go.mod go.sum /src/
RUN go mod download
COPY . .
RUN go generate
RUN VERSION=$(git describe --tags)-$(git rev-parse --short HEAD) && \
go build \
-ldflags="-w -X '${VERSION}' -X '${VERSION}' -linkmode external -extldflags '-static'" \
-o /calendar main.go
FROM scratch as release
COPY --from=backend /calendar .
CMD ["/calendar"]