1
0
Fork 0
mirror of https://github.com/librenms/docker.git synced 2026-07-21 01:15:53 +00:00

LibreNMS 1.64

Python 2 removed (librenms/librenms#11531)
This commit is contained in:
CrazyMax 2020-06-01 10:11:21 +02:00
parent 4d1bdba9bb
commit 97099891e1
No known key found for this signature in database
GPG key ID: 3248E46B6BB8C7F7
5 changed files with 36 additions and 39 deletions

View file

@ -1,5 +1,10 @@
# Changelog
## 1.64-RC1 (2020/06/01)
* LibreNMS 1.64
* Python 2 removed (librenms/librenms#11531)
## 1.63-RC7 (2020/05/28)
* Use recommended `lnms` command

View file

@ -15,8 +15,6 @@ LABEL maintainer="CrazyMax" \
org.opencontainers.image.description="LibreNMS" \
org.opencontainers.image.licenses="MIT"
ENV SYSLOGNG_VERSION="3.22.1-r2"
RUN apk --update --no-cache add \
busybox-extras \
acl \
@ -68,14 +66,12 @@ RUN apk --update --no-cache add \
php7-tokenizer \
php7-xml \
php7-zip \
python \
py2-pip \
python3 \
rrdtool \
runit \
shadow \
su-exec \
syslog-ng=${SYSLOGNG_VERSION} \
syslog-ng=3.22.1-r2 \
ttf-dejavu \
tzdata \
util-linux \
@ -85,56 +81,52 @@ RUN apk --update --no-cache add \
make \
mariadb-dev \
musl-dev \
python-dev \
python3-dev \
&& pip2 install --upgrade pip \
&& pip2 install python-memcached mysqlclient \
&& pip3 install --upgrade pip \
&& pip3 install python-memcached mysqlclient \
&& pip3 install python-memcached mysqlclient --upgrade \
&& wget -q "https://github.com/just-containers/s6-overlay/releases/latest/download/s6-overlay-amd64.tar.gz" -qO "/tmp/s6-overlay-amd64.tar.gz" \
&& tar xzf /tmp/s6-overlay-amd64.tar.gz -C / \
&& curl -sSL https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer \
&& apk del build-dependencies \
&& rm -rf /var/cache/apk/* /var/www/* /tmp/* \
&& setcap cap_net_raw+ep /usr/bin/nmap \
&& setcap cap_net_raw+ep /usr/sbin/fping
ENV S6_BEHAVIOUR_IF_STAGE2_FAILS="2" \
LIBRENMS_VERSION="1.63" \
LIBRENMS_VERSION="1.64" \
LIBRENMS_PATH="/opt/librenms" \
LIBRENMS_DOCKER="1" \
TZ="UTC" \
PUID="1000" \
PGID="1000"
RUN mkdir -p /opt \
&& curl -sSL https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer \
&& git clone --branch ${LIBRENMS_VERSION} https://github.com/librenms/librenms.git ${LIBRENMS_PATH} \
&& COMPOSER_CACHE_DIR="/tmp" composer install --no-dev --no-interaction --no-ansi --working-dir=${LIBRENMS_PATH} \
RUN addgroup -g ${PGID} librenms \
&& adduser -D -h /home/librenms -u ${PUID} -G librenms -s /bin/sh -D librenms \
&& curl -sSLk -q https://raw.githubusercontent.com/librenms/librenms-agent/master/snmp/distro -o /usr/bin/distro \
&& chmod +x /usr/bin/distro \
&& mkdir -p ${LIBRENMS_PATH}/config.d \
&& cp ${LIBRENMS_PATH}/config.php.default ${LIBRENMS_PATH}/config.php \
&& cp ${LIBRENMS_PATH}/snmpd.conf.example /etc/snmp/snmpd.conf \
&& sed -i "1s|.*|#!/usr/bin/env python3|" ${LIBRENMS_PATH}/snmp-scan.py \
&& echo "foreach (glob(\"/data/config/*.php\") as \$filename) include \$filename;" >> ${LIBRENMS_PATH}/config.php \
&& echo "foreach (glob(\"${LIBRENMS_PATH}/config.d/*.php\") as \$filename) include \$filename;" >> ${LIBRENMS_PATH}/config.php \
&& pip3 install -r ${LIBRENMS_PATH}/requirements.txt \
&& git clone https://github.com/librenms-plugins/Weathermap.git ${LIBRENMS_PATH}/html/plugins/Weathermap \
&& chmod +x /usr/bin/distro
WORKDIR ${LIBRENMS_PATH}
RUN git clone --branch ${LIBRENMS_VERSION} https://github.com/librenms/librenms.git . \
&& pip3 install -r requirements.txt --upgrade \
&& COMPOSER_CACHE_DIR="/tmp" composer install --no-dev --no-interaction --no-ansi \
&& mkdir config.d \
&& cp config.php.default config.php \
&& cp snmpd.conf.example /etc/snmp/snmpd.conf \
&& sed -i '/runningUser/d' lnms \
&& echo "foreach (glob(\"/data/config/*.php\") as \$filename) include \$filename;" >> config.php \
&& echo "foreach (glob(\"${LIBRENMS_PATH}/config.d/*.php\") as \$filename) include \$filename;" >> config.php \
&& git clone https://github.com/librenms-plugins/Weathermap.git ./html/plugins/Weathermap \
&& chown -R nobody.nogroup ${LIBRENMS_PATH} \
&& rm -rf ${LIBRENMS_PATH}/.git \
${LIBRENMS_PATH}/html/plugins/Test \
${LIBRENMS_PATH}/html/plugins/Weathermap/.git \
${LIBRENMS_PATH}/html/plugins/Weathermap/configs \
&& rm -rf .git \
html/plugins/Test \
html/plugins/Weathermap/.git \
html/plugins/Weathermap/configs \
/tmp/*
COPY rootfs /
RUN addgroup -g ${PGID} librenms \
&& adduser -D -h ${LIBRENMS_PATH} -u ${PUID} -G librenms -s /bin/sh -D librenms \
&& chmod a+x /usr/local/bin/*
RUN chmod a+x /usr/local/bin/*
EXPOSE 8000 514 514/udp
WORKDIR ${LIBRENMS_PATH}
VOLUME [ "/data" ]
ENTRYPOINT [ "/init" ]

View file

@ -12,7 +12,7 @@
## About
🐳 [LibreNMS](https://www.librenms.org/) Docker image based on Alpine Linux and Nginx.<br />
It's a fork of [CrazyMax's LibreNMS Docker image repository](https://github.com/crazy-max/docker-librenms). If you are interested, [check out](https://hub.docker.com/r/crazymax/) his other 🐳 Docker images!
If you are interested, [check out](https://hub.docker.com/r/crazymax/) my other Docker images!
💡 Want to be notified of new releases? Check out 🔔 [Diun (Docker Image Update Notifier)](https://github.com/crazy-max/diun) project!

View file

@ -7,10 +7,11 @@ $ docker-compose exec --user librenms librenms php validate.php
====================================
Component | Version
--------- | -------
LibreNMS | 1.58
DB Schema | 2019_10_03_211702_serialize_config (147)
PHP | 7.3.11
MySQL | 10.4.8-MariaDB-1:10.4.8+maria~bionic
LibreNMS | 1.64
DB Schema | 2020_04_19_010532_eventlog_sensor_reference_cleanup (165)
PHP | 7.3.18
Python | 3.8.2
MySQL | 10.4.13-MariaDB-1:10.4.13+maria~bionic
RRDTool | 1.7.2
SNMP | NET-SNMP 5.8
====================================
@ -18,8 +19,6 @@ SNMP | NET-SNMP 5.8
[OK] Installed from the official Docker image; no Composer required
[OK] Database connection successful
[OK] Database schema correct
[WARN] You have not added any devices yet.
[FIX] You can add a device in the webui or with ./addhost.php
[WARN] IPv6 is disabled on your server, you will not be able to add IPv6 devices.
[WARN] Updates are managed through the official Docker image
```

View file

@ -9,6 +9,7 @@ chown librenms. \
"${LIBRENMS_PATH}" \
"${LIBRENMS_PATH}/html/plugins/Weathermap/output"
chown -R librenms. \
/home/librenms \
/tpls \
/var/lib/nginx \
/var/log/nginx \