forked from elastic/elasticsearch-k8s-metrics-adapter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
31 lines (22 loc) · 1.55 KB
/
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
FROM --platform=$TARGETPLATFORM docker.io/library/golang:1.20.4 as builder
WORKDIR /go/src/github.com/elastic/elasticsearch-k8s-metrics-adapter
COPY ["go.mod", "go.sum", "./"]
COPY generated/ generated/
COPY pkg/ pkg/
COPY main.go main.go
RUN CGO_ENABLED=0 GOOS=linux go build -o elasticsearch-k8s-metrics-adapter github.com/elastic/elasticsearch-k8s-metrics-adapter
FROM gcr.io/distroless/static:nonroot
ARG VERSION
LABEL name="Elasticsearch Adapter for the Kubernetes Metrics API" \
io.k8s.display-name="Elasticsearch " \
maintainer="[email protected]" \
vendor="Elastic" \
version="$VERSION" \
url="https://github.com/elastic/elasticsearch-k8s-metrics-adapter/" \
summary="The Elasticsearch adapter for the K8S metrics APIs is an implementation of the Kubernetes resource metrics and custom metrics APIs." \
description="The Elasticsearch adapter can be used to automatically scale applications, using the Horizontal Pod Autoscaler, querying metrics collected by Metricbeat or Agent and stored in an Elasticsearch cluster." \
io.k8s.description="The Elasticsearch adapter can be used to automatically scale applications, using the Horizontal Pod Autoscaler, querying metrics collected by Metricbeat or Agent and stored in an Elasticsearch cluster."
COPY --from=builder /go/src/github.com/elastic/elasticsearch-k8s-metrics-adapter/elasticsearch-k8s-metrics-adapter /
# Copy NOTICE.txt and LICENSE.txt into the image
COPY ["NOTICE.txt", "LICENSE.txt", "/licenses/"]
ENTRYPOINT ["/elasticsearch-k8s-metrics-adapter"]