26 lines
1.1 KiB
Docker
26 lines
1.1 KiB
Docker
|
FROM [[ .docker.repo ]][[ .docker.base_images.alpine.image ]] AS builder
|
||
|
|
||
|
ARG ES_EXPORTER_VERSION=[[ .elasticsearch.exporter.version ]]
|
||
|
|
||
|
RUN set -eux &&\
|
||
|
apk add curl ca-certificates &&\
|
||
|
cd /tmp &&\
|
||
|
curl -sSLO https://github.com/prometheus-community/elasticsearch_exporter/releases/download/v${ES_EXPORTER_VERSION}/elasticsearch_exporter-${ES_EXPORTER_VERSION}.linux-amd64.tar.gz &&\
|
||
|
curl -sSLO https://github.com/prometheus-community/elasticsearch_exporter/releases/download/v${ES_EXPORTER_VERSION}/sha256sums.txt &&\
|
||
|
grep "elasticsearch_exporter-${ES_EXPORTER_VERSION}.linux-amd64.tar.gz" sha256sums.txt | sha256sum -c &&\
|
||
|
tar xzf elasticsearch_exporter-${ES_EXPORTER_VERSION}.linux-amd64.tar.gz &&\
|
||
|
mv elasticsearch_exporter-${ES_EXPORTER_VERSION}.linux-amd64/elasticsearch_exporter /
|
||
|
|
||
|
FROM [[ .docker.repo ]][[ .docker.base_images.alpine.image ]]
|
||
|
MAINTAINER [[ .docker.maintainer ]]
|
||
|
|
||
|
RUN set -eux &&\
|
||
|
apk --no-cache upgrade &&\
|
||
|
apk add ca-certificates
|
||
|
|
||
|
COPY --from=builder /elasticsearch_exporter /usr/local/bin/
|
||
|
|
||
|
EXPOSE 9114
|
||
|
USER 9114
|
||
|
CMD ["elasticsearch_exporter"]
|