forked from grafana/beyla
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathk8scache.Dockerfile
More file actions
36 lines (27 loc) · 853 Bytes
/
k8scache.Dockerfile
File metadata and controls
36 lines (27 loc) · 853 Bytes
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
# Build the binary for the k8s-cache service
FROM golang:1.25@sha256:0d8c14c93010e9eab98599f1ddd37e80b8fd39e9c662d670c4e4d9d0b101831d 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-cache
# Create final image from minimal + built binary
FROM scratch
LABEL maintainer="Grafana Labs <hello@grafana.com>"
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 .
ENTRYPOINT [ "/k8s-cache" ]