ms-tester/Dockerfile
Vyacheslav1557 3c0f01630f refactor:
2024-08-16 16:05:29 +05:00

15 lines
426 B
Docker

FROM golang:1.22-alpine AS base
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
FROM base AS builder
RUN --mount=type=cache,target=/go/pkg/mod/ \
--mount=type=bind,target=. \
go build -o /bin/server .
FROM scratch AS runner
COPY --from=builder /bin/server /bin/
ENTRYPOINT [ "/bin/server" ]