tstor/Dockerfile
royalcat 93892a6f1d
All checks were successful
docker / build-docker (linux/arm64) (push) Successful in 1m48s
docker / build-docker (linux/amd64) (push) Successful in 1m54s
remove distribyted ui
2024-07-09 00:24:42 +03:00

21 lines
567 B
Docker

FROM --platform=$BUILDPLATFORM golang:1.22 AS builder
WORKDIR /app
COPY go.mod ./
COPY go.sum ./
RUN --mount=type=cache,mode=0777,target=/go/pkg/mod go mod download all
COPY ./pkg ./pkg
COPY ./src ./src
COPY ./cmd ./cmd
ARG TARGETOS TARGETARCH
RUN --mount=type=cache,mode=0777,target=/go/pkg/mod CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH go build -tags timetzdata -o /tstor ./cmd/tstor/main.go
FROM scratch
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --from=builder /tstor /tstor
ENTRYPOINT ["/tstor"]