-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathDockerfile
32 lines (23 loc) · 1.76 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
32
FROM docker.elastic.co/wolfi/go:1.23.5-r1@sha256:410307b16f90cfed7faf72057ecb6b0c5c409cf78fb0fd98d3bffc495adb6555 as builder
ARG VERSION
ARG SOURCE_COMMIT
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 -ldflags "-X main.serviceVersion=$(echo $SOURCE_COMMIT | cut -c 1-12)" -o elasticsearch-k8s-metrics-adapter github.com/elastic/elasticsearch-k8s-metrics-adapter
FROM docker.elastic.co/wolfi/static:latest@sha256:5497b01f36ef14a5198c0165e50ae6a0006d0c7457d4566f1110257e1c0812ed
LABEL name="Elasticsearch Adapter for the Kubernetes Metrics API" \
io.k8s.display-name="Elasticsearch " \
maintainer="eck@elastic.co" \
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"]