-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
38 lines (28 loc) · 789 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
36
37
38
# Build the autoinstrumenter binary
FROM golang:1.23 AS builder
ARG TARGETARCH
ENV GOARCH=$TARGETARCH
WORKDIR /opt/app-root
# Copy the go manifests and source
COPY go.mod go.mod
COPY go.sum go.sum
COPY LICENSE LICENSE
COPY NOTICE NOTICE
COPY Makefile Makefile
COPY third_party_licenses.csv third_party_licenses.csv
COPY cmd/ cmd/
COPY pkg/ pkg/
COPY vendor/ vendor/
COPY .git/ .git/
# Build
RUN make compile
# Create final image from minimal + built binary
FROM debian:bookworm-slim
LABEL maintainer="Grafana Labs <[email protected]>"
WORKDIR /
COPY --from=builder /opt/app-root/bin/k8s-cache .
COPY --from=builder /opt/app-root/LICENSE .
COPY --from=builder /opt/app-root/NOTICE .
COPY --from=builder /opt/app-root/third_party_licenses.csv .
USER 0:0
ENTRYPOINT [ "/k8s-cache" ]