forked from dcsg/docker-influxdb-grafana-telegraf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
84 lines (71 loc) · 2.97 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
ARG TARGETOS
FROM arm64v8/debian:bullseye-slim as debian-arm64
FROM arm32v7/debian:bullseye-slim as debian-arm
LABEL maintainer="Dick Pluim <[email protected]>"
FROM debian-${TARGETARCH}
# Default versions
ENV INFLUXDB_VERSION=1.8.10
ENV TELEGRAF_VERSION=1.25.1
ENV GRAFANA_VERSION=9.3.6
ENV GF_DATABASE_TYPE=sqlite3
WORKDIR /root
# Clear previous sources
RUN rm /var/lib/apt/lists/* -vf \
# Base dependencies
&& apt-get -y update \
&& apt-get -y install \
apt-transport-https \
apt-utils \
ca-certificates \
curl \
dialog \
git \
htop \
libfontconfig1 \
lsof \
nano \
procps \
vim \
net-tools \
wget \
gnupg \
supervisor
# Install InfluxDB
ARG TARGETARCH
ARG ARCH=${TARGETARCH}
RUN if [ "${TARGETARCH}" = "arm" ]; then ARCH="armhf"; fi && \
if [ "$[TARGETARCH]" = "arm64" ]; then ARCH="arm64"; fi && \
wget https://dl.influxdata.com/influxdb/releases/influxdb_${INFLUXDB_VERSION}_${ARCH}.deb \
&& dpkg -i influxdb_${INFLUXDB_VERSION}_${ARCH}.deb && rm influxdb_${INFLUXDB_VERSION}_${ARCH}.deb \
# Install Telegraf
&& wget https://dl.influxdata.com/telegraf/releases/telegraf-${TELEGRAF_VERSION}_linux_${ARCH}.tar.gz \
&& tar -xf telegraf-${TELEGRAF_VERSION}_linux_${ARCH}.tar.gz -C / && rm telegraf-${TELEGRAF_VERSION}_linux_${ARCH}.tar.gz \
&& cd /telegraf-${TELEGRAF_VERSION} && cp -R * / && cd / && rm -rf telegraf-${TELEGRAF_VERSION} \
&& groupadd -g 998 telegraf && useradd -ms /bin/bash -u 998 -g 998 telegraf \
# Install Grafana
&& apt-get install -y adduser libfontconfig1 \
&& wget https://dl.grafana.com/oss/release/grafana_${GRAFANA_VERSION}_${ARCH}.deb \
&& dpkg -i grafana_${GRAFANA_VERSION}_${ARCH}.deb && rm grafana_${GRAFANA_VERSION}_${ARCH}.deb \
# Cleanup
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
# Configure Supervisord
&& mkdir -p /var/log/supervisor
COPY supervisord/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
# Configure InfluxDB
COPY influxdb/influxdb.conf /etc/influxdb/influxdb.conf
COPY influxdb/init.sh /etc/init.d/influxdb
RUN chmod 0755 /etc/init.d/influxdb
# Configure Grafana
COPY grafana/grafana.ini /etc/grafana/grafana.ini
# Configure Telegraf
COPY telegraf/init.sh /etc/init.d/telegraf
RUN chmod 0755 /etc/init.d/telegraf
LABEL org.opencontainers.image.authors="Dick Pluim" \
org.opencontainers.image.title="pluim003/docker-influxdb-grafana-telegraf" \
org.opencontainers.image.description="Docker image with Influxdb, Grafana and Telegraf" \
org.opencontainers.image.url="https://github.com/pluim003/docker-influxdb-grafana-telegraf" \
org.opencontainers.image.licenses="MIT" \
org.opencontainers.image.source="https://github.com/pluim003/docker-influxdb-grafana-telegraf" \
org.opencontainers.image.original_source="https://github.com/dcsg/docker-influxdb-grafana-telegraf"
CMD [ "/usr/bin/supervisord" ]