mirror of
https://github.com/11notes/docker-telegraf.git
synced 2025-10-23 08:12:14 +00:00
1.26.3
This commit is contained in:
33
README.md
33
README.md
@@ -1,18 +1,20 @@
|
||||
# Info
|
||||
The plugin-driven server agent for collecting & reporting metrics.
|
||||
|
||||
This container provides an easy and simple way to use telegraf without the hassle of library dependencies and compiling the source yourself.
|
||||
|
||||
## Volumes
|
||||
None
|
||||
# Alpine :: Telegraf
|
||||
Run Nodejs based on Alpine Linux. Small, lightweight, secure and fast 🏔️
|
||||
|
||||
## Run
|
||||
```shell
|
||||
docker run --name telegraf \
|
||||
-v /.../telegraf.conf:/telegraf/etc/telegraf.conf:ro \
|
||||
-d 11notes/telegraf:[tag]
|
||||
-v /.../telegraf.conf:/telegraf/etc/telegraf.conf:ro \
|
||||
-d 11notes/telegraf:[tag]
|
||||
```
|
||||
|
||||
## Defaults
|
||||
| Parameter | Value | Description |
|
||||
| --- | --- | --- |
|
||||
| `user` | docker | user docker |
|
||||
| `uid` | 1000 | user id 1000 |
|
||||
| `gid` | 1000 | group id 1000 |
|
||||
|
||||
# Examples telegraf.conf
|
||||
```shell
|
||||
[agent]
|
||||
@@ -36,6 +38,13 @@ docker run --name telegraf \
|
||||
urls = ["http://localhost:8080/metrics"]
|
||||
```
|
||||
|
||||
## Build with
|
||||
* [telegraf](https://github.com/influxdata/telegraf) - Telegraf
|
||||
* [Alpine Linux](https://alpinelinux.org/) - Alpine Linux
|
||||
## Parent
|
||||
* [11notes/alpine:stable](https://github.com/11notes/docker-alpine)
|
||||
|
||||
## Built with
|
||||
* [telegraf](https://github.com/influxdata/telegraf)
|
||||
* [Alpine Linux](https://alpinelinux.org/)
|
||||
|
||||
## Tips
|
||||
* Don't bind to ports < 1024 (requires root), use NAT/reverse proxy
|
||||
* [Permanent Stroage](https://github.com/11notes/alpine-docker-netshare) - Module to store permanent container data via NFS/CIFS and more
|
@@ -1,6 +1,6 @@
|
||||
# :: Build
|
||||
FROM golang:alpine as telegraf
|
||||
ENV checkout=v1.26.1
|
||||
FROM golang:alpine as build
|
||||
ENV checkout=v1.26.3
|
||||
|
||||
RUN set -ex; \
|
||||
apk add --update --no-cache \
|
||||
@@ -13,34 +13,33 @@
|
||||
mv telegraf /usr/local/bin;
|
||||
|
||||
# :: Header
|
||||
FROM alpine:latest
|
||||
COPY --from=telegraf /usr/local/bin/ /usr/local/bin
|
||||
FROM 11notes/alpine:stable
|
||||
COPY --from=build /usr/local/bin/ /usr/local/bin
|
||||
|
||||
# :: Run
|
||||
USER root
|
||||
|
||||
# :: prepare
|
||||
# :: update image
|
||||
RUN set -ex; \
|
||||
apk update; \
|
||||
apk upgrade;
|
||||
|
||||
# :: prepare image
|
||||
RUN set -ex; \
|
||||
mkdir -p /telegraf; \
|
||||
mkdir -p /telegraf/etc;
|
||||
|
||||
RUN set -ex; \
|
||||
apk add --update --no-cache \
|
||||
shadow;
|
||||
|
||||
RUN set -ex; \
|
||||
addgroup --gid 1000 -S telegraf; \
|
||||
adduser --uid 1000 -D -S -h /telegraf -s /sbin/nologin -G telegraf telegraf;
|
||||
|
||||
# :: copy root filesystem changes
|
||||
# :: copy root filesystem changes and add execution rights to init scripts
|
||||
COPY ./rootfs /
|
||||
|
||||
# :: docker -u 1000:1000 (no root initiative)
|
||||
RUN set -ex; \
|
||||
chown -R telegraf:telegraf \
|
||||
/telegraf
|
||||
chmod +x -R /usr/local/bin;
|
||||
|
||||
# :: change home path for existing user and set correct permission
|
||||
RUN set -ex; \
|
||||
usermod -d /telegraf docker; \
|
||||
chown -R 1000:1000 \
|
||||
/telegraf;
|
||||
|
||||
# :: Start
|
||||
RUN set -ex; chmod +x /usr/local/bin/entrypoint.sh
|
||||
USER telegraf
|
||||
USER docker
|
||||
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
|
Reference in New Issue
Block a user