-
-
Notifications
You must be signed in to change notification settings - Fork 63
Expand file tree
/
Copy pathDockerfile
More file actions
23 lines (18 loc) · 567 Bytes
/
Copy pathDockerfile
File metadata and controls
23 lines (18 loc) · 567 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
FROM golang:1.26.5 AS builder
WORKDIR /build
COPY go.mod go.sum ./
RUN --mount=type=cache,target=/go/pkg/mod \
go mod download
COPY . .
RUN --mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/go/pkg/mod \
CGO_ENABLED=0 go build -buildvcs=false ./cmd/mc-router
FROM alpine AS certs
RUN apk add -U \
ca-certificates \
tzdata
FROM scratch
ENTRYPOINT ["/mc-router"]
COPY --from=certs /etc/ssl/certs/ /etc/ssl/certs
COPY --from=certs /usr/share/zoneinfo /usr/share/zoneinfo
COPY --from=builder /build/mc-router /mc-router