-
Notifications
You must be signed in to change notification settings - Fork 22
/
Dockerfile
55 lines (44 loc) · 2.3 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
FROM ubuntu:24.04
ENV TELEGRAF_VERSION 1.31.3-1
ENV GRAFANA_VERSION 11.1.3
ENV VM_VERSION v1.102.1
ENV ARCH amd64
ENV GRAFANA_VM_PLUGIN_VERSION v0.8.5
ENV PLUGIN_PATH /var/lib/grafana/plugins
# Download and install Grafana
RUN set -ex && \
apt-get update && \
apt-get install -qq -y curl libfontconfig musl adduser && \
curl -O https://dl.grafana.com/oss/release/grafana_${GRAFANA_VERSION}_${ARCH}.deb && \
dpkg -i grafana_${GRAFANA_VERSION}_${ARCH}.deb && \
rm -f grafana_${GRAFANA_VERSION}_${ARCH}.deb
# Copy the bundled dashboards for the spark-dashboard
COPY grafana_dashboards /var/lib/grafana/dashboards
COPY spark.yaml /etc/grafana/provisioning/dashboards/spark.yaml
# Install and configure Grafana datasource for VictoriaMetric
RUN set -ex && \
curl -L -O https://github.com/VictoriaMetrics/grafana-datasource/releases/download/${GRAFANA_VM_PLUGIN_VERSION}/victoriametrics-datasource-${GRAFANA_VM_PLUGIN_VERSION}.tar.gz && \
tar -xzf victoriametrics-datasource-${GRAFANA_VM_PLUGIN_VERSION}.tar.gz && \
find victoriametrics-datasource -type f -name "victoriametrics_backend_plugin*" ! -name "*linux_amd64" -exec rm -f {} + && \
mkdir ${PLUGIN_PATH} && \
mv victoriametrics-datasource ${PLUGIN_PATH} && \
rm victoriametrics-datasource-${GRAFANA_VM_PLUGIN_VERSION}.tar.gz
COPY grafana.ini /etc/grafana/grafana.ini
COPY victoriametrics-datasource.yml /etc/grafana/provisioning/datasources/victoriametrics-datasource.yml
# Install and configure Telegraf
RUN set -ex && \
curl -O https://repos.influxdata.com/debian/packages/telegraf_${TELEGRAF_VERSION}_${ARCH}.deb && \
dpkg -i telegraf_${TELEGRAF_VERSION}_${ARCH}.deb && \
rm -f telegraf_${TELEGRAF_VERSION}_${ARCH}.deb
COPY telegraf.conf /etc/telegraf/telegraf.conf
# Download and install VictoriaMetrics (VM)
RUN set -ex && \
curl -L -O https://github.com/VictoriaMetrics/VictoriaMetrics/releases/download/${VM_VERSION}/victoria-metrics-linux-${ARCH}-${VM_VERSION}.tar.gz && \
tar -xzvf victoria-metrics-*.tar.gz && \
rm -f victoria-metrics-linux-${ARCH}-${VM_VERSION}.tar.gz
# Copy the entrypoint script, it contains the startup commands
COPY entrypoint.sh /opt/entrypoint.sh
# Expose the ports for Grafana, Telegraf and VictoriaMetrics
EXPOSE 3000/tcp 2003/tcp 8428/tcp
WORKDIR /
ENTRYPOINT [ "/opt/entrypoint.sh" ]