Sign inSign up

shilazi/collectd

By shilazi

•Updated almost 3 years ago

Collectd base on Debian bookworm

Image
0

261

shilazi/collectd repository overview

⁠A simple image for collectd⁠

This image work with ping⁠ and interface⁠ plugins.

⁠Dockerfile

FROM python:3.11-slim-bookworm

ARG COLLECTD_VER=5.12.0-14
ENV COLLECTD_VER=${COLLECTD_VER}

ENV WEB_PORT=80

ENV TZ=Asia/Shanghai
RUN set -x \
    && ln -snf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
    && echo 'Asia/Shanghai' > /etc/timezone

RUN set -x \
    && DEBIAN_FRONTEND=noninteractive apt-get update \
    && DEBIAN_FRONTEND=noninteractive apt-get install -y \
        --no-install-recommends collectd liboping0 nginx git git-lfs \
        librrds-perl libjson-perl libhtml-parser-perl libcgi-pm-perl \
    && git clone https://github.com/shilazi/collectd-web /web \
    && DEBIAN_FRONTEND=noninteractive apt-get remove -y --purge git git-lfs \
    && DEBIAN_FRONTEND=noninteractive apt-get autoremove -y \
    && rm -rf /var/lib/apt/lists/* /etc/nginx/site-* /var/www/html/* \
    && sed -i '/sites-enabled/d' /etc/nginx/nginx.conf \
    && ln -sf /dev/sdterr /var/log/nginx/error.log \
    && ln -sf /dev/sdtout /var/log/nginx/access.log

WORKDIR /web

VOLUME ["/var/lib/collectd/"]

EXPOSE ${WEB_PORT}

ADD html/ /var/www/html/
ADD nginx.conf /etc/nginx/conf.d/default.conf
ADD collectd.example.conf /etc/collectd/

ADD entrypoint.sh /entrypoint.sh

CMD ["sh", "-c", "/entrypoint.sh"]

⁠Usage

compose

version: "3.9"

services:
  collectd:
    container_name: collectd
    image: shilazi/collectd:v5.12.0-14
    pull_policy: missing
    environment:
    - WEB_PORT=80
    network_mode: host
    volumes:
    - ./data/:/var/lib/collectd/
    restart: unless-stopped

⁠Visit

Visit http://ip for WebUI, edit Host with ./data/collectd.conf and ./data/www/*.html as needed.

Tag summary

Content type

Image

Digest

sha256:d729a2044…

Size

89.6 MB

Last updated

almost 3 years ago

docker pull shilazi/collectd:v5.12.0-14