forked from jirs5/tracing-proxy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
35 lines (22 loc) · 939 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
FROM --platform=$BUILDPLATFORM golang:1.22.5-alpine3.19 as builder
ARG TARGETOS
ARG TARGETARCH
RUN apk update && apk add --no-cache git bash ca-certificates && update-ca-certificates
ARG BUILD_ID="17.1.6"
WORKDIR /app
ADD go.mod go.sum ./
RUN go mod download
RUN go mod verify
ADD . .
RUN CGO_ENABLED=0 \
GOOS=${TARGETOS} \
GOARCH=${TARGETARCH} \
go build -ldflags "-X main.BuildID=${BUILD_ID}" \
-o tracing-proxy \
./cmd/tracing-proxy
FROM --platform=$TARGETPLATFORM alpine:3.19
RUN apk update && apk add --no-cache bash ca-certificates && update-ca-certificates
COPY --from=builder /app/config_complete.yaml /etc/tracing-proxy/config.yaml
COPY --from=builder /app/rules_complete.yaml /etc/tracing-proxy/rules.yaml
COPY --from=builder /app/tracing-proxy /usr/bin/tracing-proxy
CMD ["/usr/bin/tracing-proxy", "--config", "/etc/tracing-proxy/config.yaml", "--rules_config", "/etc/tracing-proxy/rules.yaml"]