mirror of
https://github.com/11notes/docker-telegraf.git
synced 2025-10-23 00:02:10 +00:00
update 1.28.3
This commit is contained in:
10
README.md
10
README.md
@@ -1,12 +1,12 @@
|
||||
# Alpine :: Telegraf
|
||||
   
|
||||
    
|
||||
|
||||
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/)
|
||||
|
||||
|
@@ -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
|
||||
|
@@ -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 "$@"
|
Reference in New Issue
Block a user