update 1.28.3

This commit is contained in:
ElevenNotes
2023-10-27 11:02:53 +02:00
parent 11e23b61c8
commit fa3011b369
3 changed files with 14 additions and 17 deletions

View File

@@ -1,12 +1,12 @@
# Alpine :: Telegraf
![pulls](https://img.shields.io/docker/pulls/11notes/telegraf?color=2b75d6) ![build](https://img.shields.io/docker/automated/11notes/telegraf?color=2b75d6) ![activity](https://img.shields.io/github/commit-activity/m/11notes/docker-telegraf?color=c91cb8) ![commit-last](https://img.shields.io/github/last-commit/11notes/docker-telegraf?color=c91cb8)
![size](https://img.shields.io/docker/image-size/11notes/telegraf/1.28.3?color=0eb305) ![version](https://img.shields.io/docker/v/11notes/telegraf?color=eb7a09) ![pulls](https://img.shields.io/docker/pulls/11notes/telegraf?color=2b75d6) ![activity](https://img.shields.io/github/commit-activity/m/11notes/docker-telegraf?color=c91cb8) ![commit-last](https://img.shields.io/github/last-commit/11notes/docker-telegraf?color=c91cb8)
Run Telegraf based on Alpine Linux. Small, lightweight, secure and fast 🏔️
## Run
```shell
docker run --name telegraf \
-v /.../telegraf.conf:/telegraf/etc/telegraf.conf:ro \
-v ../telegraf.conf:/telegraf/etc/telegraf.conf:ro \
-d 11notes/telegraf:[tag]
```
@@ -33,7 +33,7 @@ docker run --name telegraf \
hostname = "telegraf"
[[outputs.influxdb_v2]]
urls = ["http://localhost:8086"]
urls = ["https://influxdb"]
token = "**********************************************"
organization = "influxdb"
bucket = "global"
@@ -42,10 +42,10 @@ docker run --name telegraf \
urls = ["http://localhost:8080/metrics"]
```
## Parent
## Parent image
* [11notes/alpine:stable](https://github.com/11notes/docker-alpine)
## Built with
## Built with and thanks to
* [telegraf](https://github.com/influxdata/telegraf)
* [Alpine Linux](https://alpinelinux.org/)

View File

@@ -1,6 +1,6 @@
# :: Build
FROM golang:alpine as build
ENV checkout=v1.28.1
ENV APP_VERSION=v1.28.3
RUN set -ex; \
apk add --update --no-cache \
@@ -8,26 +8,23 @@
git; \
git clone https://github.com/influxdata/telegraf.git; \
cd /go/telegraf; \
git checkout ${checkout}; \
git checkout ${APP_VERSION}; \
make build -j $(nproc); \
mv telegraf /usr/local/bin;
# :: Header
FROM 11notes/alpine:stable
ENV APP_ROOT=/telegraf
COPY --from=build /usr/local/bin/ /usr/local/bin
# :: Run
USER root
# :: update image
RUN set -ex; \
apk --no-cache upgrade;
# :: prepare image
RUN set -ex; \
mkdir -p /telegraf; \
mkdir -p /telegraf/etc;
mkdir -p ${APP_ROOT}; \
mkdir -p ${APP_ROOT}/etc; \
apk --no-cache upgrade;
# :: copy root filesystem changes and add execution rights to init scripts
COPY ./rootfs /
@@ -36,9 +33,9 @@
# :: change home path for existing user and set correct permission
RUN set -ex; \
usermod -d /telegraf docker; \
usermod -d ${APP_ROOT} docker; \
chown -R 1000:1000 \
/telegraf;
${APP_ROOT};
# :: Start
USER docker

View File

@@ -1,7 +1,7 @@
#!/bin/ash
if [ -z "${1}" ]; then
set -- "telegraf" \
--config /telegraf/etc/telegraf.conf
--config ${APP_ROOT}/etc/telegraf.conf
fi
exec "$@"