0ebb8a21a1
Clean Up Testing and Linting * somescriptcleanup * mostgolangci * deplatest * imageversions * usingscratch * movedqueuefrtesting * finishedunittesting * linting * taskfilecontext
23 lines
532 B
Docker
23 lines
532 B
Docker
# syntax=docker/dockerfile:1
|
|
|
|
ARG GO_VERSION=1.23
|
|
FROM golang:${GO_VERSION} AS build
|
|
WORKDIR /src
|
|
|
|
RUN --mount=type=cache,target=/go/pkg/mod/ \
|
|
--mount=type=bind,source=go.sum,target=go.sum \
|
|
--mount=type=bind,source=go.mod,target=go.mod \
|
|
go mod download -x
|
|
|
|
ARG TARGETARCH
|
|
|
|
RUN --mount=type=cache,target=/go/pkg/mod/ \
|
|
--mount=type=bind,target=. \
|
|
CGO_ENABLED=0 GOARCH=$TARGETARCH go build -o /bin ./cmd/...
|
|
|
|
FROM scratch AS final
|
|
|
|
COPY database/migrations/ database/migrations/
|
|
|
|
COPY --from=build /bin/ /bin/
|