diff --git a/Dockerfile b/Dockerfile index 6f2a7af..fbc0436 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,9 +2,10 @@ FROM golang:alpine AS build WORKDIR /app/ -RUN apk add --no-cache build-base libwebp-dev +RUN apk add --no-cache build-base libwebp-dev git COPY . . +COPY ./.git/ ./.git/ RUN --mount=type=cache,target=/root/.cache/go-build \ go build -ldflags "-s -w -X 'main.version=$(date '+%Y-%m-%d')-$(git rev-list --abbrev-commit -1 HEAD)'"