incorporate upstream 'latest' dir
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
ee41e013de
commit
1a5e30978e
|
@ -1,16 +1,21 @@
|
|||
FROM debian:jessie
|
||||
FROM debian:stretch
|
||||
|
||||
ADD scripts/build.sh /build.sh
|
||||
ADD scripts/run.sh /run.sh
|
||||
|
||||
RUN chmod +x /run.sh /build.sh && sync && sleep 1 && /build.sh
|
||||
|
||||
RUN touch /etc/netdata/.opt-out-from-anonymous-statistics
|
||||
|
||||
WORKDIR /
|
||||
|
||||
ENV NETDATA_PORT=19999 SSMTP_TLS=YES SSMTP_SERVER=smtp.gmail.com SSMTP_PORT=587 SSMTP_HOSTNAME=localhost
|
||||
ENV NETDATA_PORT=19999 SMTP_TLS=on SMTP_STARTTLS=on SMTP_SERVER=smtp.example.com SMTP_PORT=587 SMTP_FROM=localhost
|
||||
|
||||
# supposedly it now respects this
|
||||
ENV DO_NOT_TRACK=1
|
||||
|
||||
EXPOSE $NETDATA_PORT
|
||||
|
||||
VOLUME /etc/netdata/override
|
||||
|
||||
ENTRYPOINT ["/run.sh"]
|
||||
|
|
|
@ -2,22 +2,20 @@
|
|||
set -e
|
||||
DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
# some mirrors have issues, i skipped httpredir in favor of an eu mirror
|
||||
|
||||
echo "deb http://ftp.nl.debian.org/debian/ jessie main" > /etc/apt/sources.list
|
||||
echo "deb http://security.debian.org/debian-security jessie/updates main" >> /etc/apt/sources.list
|
||||
# belt and suspenders
|
||||
export DO_NOT_TRACK=1
|
||||
|
||||
# install dependencies for build
|
||||
|
||||
apt-get -qq update
|
||||
apt-get -y install zlib1g-dev uuid-dev libmnl-dev gcc make curl git autoconf autogen automake pkg-config netcat-openbsd jq
|
||||
apt-get -y install autoconf-archive lm-sensors nodejs python python-mysqldb python-yaml
|
||||
apt-get -y install ssmtp mailutils apcupsd
|
||||
apt-get -y install zlib1g-dev uuid-dev libmnl-dev gcc make curl git autoconf autogen automake pkg-config netcat-openbsd jq libuv1-dev liblz4-dev libjudy-dev libssl-dev
|
||||
apt-get -y install autoconf-archive lm-sensors nodejs python python-mysqldb python-yaml libjudydebian1 libuv1 liblz4-1 openssl
|
||||
apt-get -y install msmtp msmtp-mta apcupsd fping
|
||||
|
||||
# fetch netdata
|
||||
|
||||
git clone https://github.com/netdata/netdata.git /netdata.git
|
||||
cd /netdata.git
|
||||
# v1.19.0 release:
|
||||
git checkout 5000257f0171271cb3ee2cf0fe02e8a2154ddf2e
|
||||
|
||||
# use the provided installer
|
||||
|
@ -26,23 +24,18 @@ git checkout 5000257f0171271cb3ee2cf0fe02e8a2154ddf2e
|
|||
|
||||
touch /etc/netdata/.opt-out-from-anonymous-statistics
|
||||
|
||||
# removed hack on 2017/1/3
|
||||
#chown root:root /usr/libexec/netdata/plugins.d/apps.plugin
|
||||
#chmod 4755 /usr/libexec/netdata/plugins.d/apps.plugin
|
||||
|
||||
# remove build dependencies
|
||||
|
||||
cd /
|
||||
rm -rf /netdata.git
|
||||
|
||||
dpkg -P zlib1g-dev uuid-dev libmnl-dev gcc make git autoconf autogen automake pkg-config
|
||||
dpkg -P zlib1g-dev uuid-dev libmnl-dev gcc make git autoconf autogen automake pkg-config libuv1-dev liblz4-dev libjudy-dev libssl-dev
|
||||
apt-get -y autoremove
|
||||
apt-get clean
|
||||
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
|
||||
|
||||
# symlink access log and error log to stdout/stderr
|
||||
|
||||
ln -sf /dev/stdout /var/log/netdata/access.log
|
||||
ln -sf /dev/stdout /var/log/netdata/debug.log
|
||||
ln -sf /dev/stderr /var/log/netdata/error.log
|
||||
|
|
|
@ -4,34 +4,41 @@
|
|||
chown root:root /usr/share/netdata/web/ -R
|
||||
echo -n "" > /usr/share/netdata/web/version.txt
|
||||
|
||||
# set up ssmtp
|
||||
if [[ $SSMTP_TO ]]; then
|
||||
cat << EOF > /etc/ssmtp/ssmtp.conf
|
||||
root=$SSMTP_TO
|
||||
mailhub=$SSMTP_SERVER:$SSMTP_PORT
|
||||
UseSTARTTLS=$SSMTP_TLS
|
||||
hostname=$SSMTP_HOSTNAME
|
||||
FromLineOverride=NO
|
||||
# set up msmtp
|
||||
if [[ $SMTP_TO ]]; then
|
||||
cat << EOF > /etc/msmtprc
|
||||
account default
|
||||
aliases /etc/msmtp_aliases
|
||||
from $SMTP_FROM
|
||||
host $SMTP_SERVER
|
||||
port $SMTP_PORT
|
||||
tls $SMTP_TLS
|
||||
tls_starttls $SMTP_STARTTLS
|
||||
tls_certcheck off
|
||||
EOF
|
||||
|
||||
cat << EOF > /etc/ssmtp/revaliases
|
||||
netdata:netdata@$SSMTP_HOSTNAME:$SSMTP_SERVER:$SSMTP_PORT
|
||||
root:netdata@$SSMTP_HOSTNAME:$SSMTP_SERVER:$SSMTP_PORT
|
||||
cat << EOF > /etc/msmtp_aliases
|
||||
netdata: $SMTP_TO
|
||||
root: $SMTP_TO
|
||||
EOF
|
||||
fi
|
||||
|
||||
if [[ $SSMTP_USER ]]; then
|
||||
cat << EOF >> /etc/ssmtp/ssmtp.conf
|
||||
AuthUser=$SSMTP_USER
|
||||
if [[ $SMTP_USER ]]; then
|
||||
cat << EOF >> /etc/msmtprc
|
||||
auth on
|
||||
user $SMTP_USER
|
||||
EOF
|
||||
fi
|
||||
|
||||
if [[ $SSMTP_PASS ]]; then
|
||||
cat << EOF >> /etc/ssmtp/ssmtp.conf
|
||||
AuthPass=$SSMTP_PASS
|
||||
if [[ $SMTP_PASS ]]; then
|
||||
cat << EOF >> /etc/msmtprc
|
||||
password $SMTP_PASS
|
||||
EOF
|
||||
fi
|
||||
|
||||
# copy conf from NETDATA_STOCK_CONFIG_DIR (normally under /usr/lib/netdata/conf.d) to NETDATA_USER_CONFIG_DIR (normally under /etc/netdata)
|
||||
cp /usr/lib/netdata/conf.d/health_alarm_notify.conf /etc/netdata
|
||||
|
||||
if [[ $SLACK_WEBHOOK_URL ]]; then
|
||||
sed -i -e "s@SLACK_WEBHOOK_URL=\"\"@SLACK_WEBHOOK_URL=\"${SLACK_WEBHOOK_URL}\"@" /etc/netdata/health_alarm_notify.conf
|
||||
fi
|
||||
|
@ -107,4 +114,10 @@ for f in /etc/netdata/override/*; do
|
|||
done
|
||||
|
||||
# main entrypoint
|
||||
touch /etc/netdata/python.d.conf
|
||||
|
||||
# belt and suspenders
|
||||
export DO_NOT_TRACK=1
|
||||
touch /etc/netdata/.opt-out-from-anonymous-statistics
|
||||
|
||||
exec /usr/sbin/netdata -D -u root -s /host -p ${NETDATA_PORT} ${NETDATA_ARGS} "$@"
|
||||
|
|
Loading…
Reference in New Issue