tstor/Dockerfile

26 lines
581 B
Text
Raw Normal View History

2024-03-28 21:56:16 +00:00
FROM golang:1.22 as builder
2023-10-18 09:52:48 +00:00
WORKDIR /app
2023-10-18 09:52:48 +00:00
COPY go.mod ./
COPY go.sum ./
2024-06-19 15:00:57 +00:00
RUN --mount=type=cache,mode=0777,target=/go/pkg/mod go mod download all
2024-03-28 22:09:11 +00:00
COPY ./pkg ./pkg
2023-10-18 09:52:48 +00:00
COPY ./src ./src
COPY ./cmd ./cmd
COPY ./assets ./assets
COPY ./templates ./templates
COPY embed.go embed.go
2023-10-18 09:52:48 +00:00
RUN go generate ./...
2024-06-19 15:00:57 +00:00
RUN --mount=type=cache,mode=0777,target=/go/pkg/mod CGO_ENABLED=0 go build -tags timetzdata -o /tstor ./cmd/tstor/main.go
2023-10-18 09:52:48 +00:00
FROM scratch
2023-10-18 09:52:48 +00:00
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --from=builder /tstor /tstor
2023-10-18 09:52:48 +00:00
ENTRYPOINT ["/tstor"]