-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
103 lines (90 loc) · 3.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
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
FROM debian:stretch-slim
LABEL maintainer="Tobias Armbruster <git@tobasium.de>"
ENV DEBIAN_FRONTEND noninteractive
ENV LANG C.UTF-8
# Default versions
ENV INFLUXDB_VERSION=2.0.4
ENV CHRONOGRAF_VERSION=1.8.10
ENV GRAFANA_VERSION=7.5.3
# Grafana database type
#ENV GF_DATABASE_TYPE=sqlite3
# Fix bad proxy issue
COPY system/99fixbadproxy /etc/apt/apt.conf.d/99fixbadproxy
WORKDIR /root
# Clear previous sources
RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" && \
case "${dpkgArch##*-}" in \
amd64) ARCH='amd64';; \
arm64) ARCH='arm64';; \
armhf) ARCH='armhf';; \
armel) ARCH='armel';; \
*) echo "Unsupported architecture: ${dpkgArch}"; exit 1;; \
esac && \
rm /var/lib/apt/lists/* -vf \
# Base dependencies
&& apt-get -y update \
&& apt-get -y dist-upgrade \
&& apt-get -y --force-yes install \
apt-utils \
ca-certificates \
curl \
git \
htop \
libfontconfig \
nano \
net-tools \
# supervisor \
wget \
gnupg \
procps \
&& curl -sL https://deb.nodesource.com/setup_10.x | bash - \
&& apt-get install -y nodejs \
&& mkdir -p /var/log/supervisor \
&& rm -rf .profile \
# Install InfluxDB
&& wget --no-verbose https://dl.influxdata.com/influxdb/releases/influxdb2-${INFLUXDB_VERSION}-${ARCH}.deb \
&& dpkg -i influxdb2-${INFLUXDB_VERSION}-${ARCH}.deb \
&& rm influxdb2-${INFLUXDB_VERSION}-${ARCH}.deb \
# Install Chronograf
&& wget https://dl.influxdata.com/chronograf/releases/chronograf_${CHRONOGRAF_VERSION}_${ARCH}.deb \
&& dpkg -i chronograf_${CHRONOGRAF_VERSION}_${ARCH}.deb && rm chronograf_${CHRONOGRAF_VERSION}_${ARCH}.deb \
# Install Grafana
#&& 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/*
# Install gosu for easy step-down from root.
# https://github.com/tianon/gosu/releases
ENV GOSU_VER 1.12
RUN set -eux; \
dpkgArch="$(dpkg --print-architecture)" && \
wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VER/gosu-$dpkgArch" && \
wget -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VER/gosu-$dpkgArch.asc" && \
export GNUPGHOME="$(mktemp -d)" && \
gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 && \
gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu && \
gpgconf --kill all && \
rm -rf "$GNUPGHOME" /usr/local/bin/gosu.asc && \
chmod +x /usr/local/bin/gosu && \
gosu --version && \
gosu nobody true
# Configure Grafana
#COPY grafana/grafana.ini /etc/grafana/grafana.ini
# Port
#EXPOSE 3003
#EXPOSE 8086
# Create standard directories expected by the entry-point.
RUN mkdir /docker-entrypoint-initdb.d && \
mkdir -p /var/lib/influxdb2 && \
chown -R influxdb:influxdb /var/lib/influxdb2 && \
mkdir -p /etc/influxdb2 && \
chown -R influxdb:influxdb /etc/influxdb2
VOLUME /var/lib/influxdb2 /etc/influxdb2
# Configure Start
COPY run.sh /run.sh
RUN ["chmod", "+x", "/run.sh"]
COPY entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
CMD ["influxd"]