From 4a912cad9a8ec8976812f871a2fdb3edeb96a228 Mon Sep 17 00:00:00 2001 From: mezned Date: Sun, 10 Nov 2024 09:45:56 +0100 Subject: [PATCH 01/29] rename folder --- {addon-promtail-main => promtail}/.README.j2 | 0 {addon-promtail-main => promtail}/DOCS.md | 0 {addon-promtail-main => promtail}/Dockerfile | 0 {addon-promtail-main => promtail}/apparmor.txt | 0 {addon-promtail-main => promtail}/build.yaml | 0 {addon-promtail-main => promtail}/config.yaml | 0 {addon-promtail-main => promtail}/icon.png | Bin {addon-promtail-main => promtail}/logo.png | Bin .../rootfs/etc/cont-init.d/promtail_setup.sh | 0 .../rootfs/etc/promtail/base_config.yaml | 0 .../rootfs/etc/promtail/default-scrape-config.yaml | 0 .../rootfs/etc/services.d/promtail/finish | 0 .../rootfs/etc/services.d/promtail/run | 0 13 files changed, 0 insertions(+), 0 deletions(-) rename {addon-promtail-main => promtail}/.README.j2 (100%) rename {addon-promtail-main => promtail}/DOCS.md (100%) rename {addon-promtail-main => promtail}/Dockerfile (100%) rename {addon-promtail-main => promtail}/apparmor.txt (100%) rename {addon-promtail-main => promtail}/build.yaml (100%) rename {addon-promtail-main => promtail}/config.yaml (100%) rename {addon-promtail-main => promtail}/icon.png (100%) rename {addon-promtail-main => promtail}/logo.png (100%) rename {addon-promtail-main => promtail}/rootfs/etc/cont-init.d/promtail_setup.sh (100%) rename {addon-promtail-main => promtail}/rootfs/etc/promtail/base_config.yaml (100%) rename {addon-promtail-main => promtail}/rootfs/etc/promtail/default-scrape-config.yaml (100%) rename {addon-promtail-main => promtail}/rootfs/etc/services.d/promtail/finish (100%) rename {addon-promtail-main => promtail}/rootfs/etc/services.d/promtail/run (100%) diff --git a/addon-promtail-main/.README.j2 b/promtail/.README.j2 similarity index 100% rename from addon-promtail-main/.README.j2 rename to promtail/.README.j2 diff --git a/addon-promtail-main/DOCS.md b/promtail/DOCS.md similarity index 100% rename from addon-promtail-main/DOCS.md rename to promtail/DOCS.md diff --git a/addon-promtail-main/Dockerfile b/promtail/Dockerfile similarity index 100% rename from addon-promtail-main/Dockerfile rename to promtail/Dockerfile diff --git a/addon-promtail-main/apparmor.txt b/promtail/apparmor.txt similarity index 100% rename from addon-promtail-main/apparmor.txt rename to promtail/apparmor.txt diff --git a/addon-promtail-main/build.yaml b/promtail/build.yaml similarity index 100% rename from addon-promtail-main/build.yaml rename to promtail/build.yaml diff --git a/addon-promtail-main/config.yaml b/promtail/config.yaml similarity index 100% rename from addon-promtail-main/config.yaml rename to promtail/config.yaml diff --git a/addon-promtail-main/icon.png b/promtail/icon.png similarity index 100% rename from addon-promtail-main/icon.png rename to promtail/icon.png diff --git a/addon-promtail-main/logo.png b/promtail/logo.png similarity index 100% rename from addon-promtail-main/logo.png rename to promtail/logo.png diff --git a/addon-promtail-main/rootfs/etc/cont-init.d/promtail_setup.sh b/promtail/rootfs/etc/cont-init.d/promtail_setup.sh similarity index 100% rename from addon-promtail-main/rootfs/etc/cont-init.d/promtail_setup.sh rename to promtail/rootfs/etc/cont-init.d/promtail_setup.sh diff --git a/addon-promtail-main/rootfs/etc/promtail/base_config.yaml b/promtail/rootfs/etc/promtail/base_config.yaml similarity index 100% rename from addon-promtail-main/rootfs/etc/promtail/base_config.yaml rename to promtail/rootfs/etc/promtail/base_config.yaml diff --git a/addon-promtail-main/rootfs/etc/promtail/default-scrape-config.yaml b/promtail/rootfs/etc/promtail/default-scrape-config.yaml similarity index 100% rename from addon-promtail-main/rootfs/etc/promtail/default-scrape-config.yaml rename to promtail/rootfs/etc/promtail/default-scrape-config.yaml diff --git a/addon-promtail-main/rootfs/etc/services.d/promtail/finish b/promtail/rootfs/etc/services.d/promtail/finish similarity index 100% rename from addon-promtail-main/rootfs/etc/services.d/promtail/finish rename to promtail/rootfs/etc/services.d/promtail/finish diff --git a/addon-promtail-main/rootfs/etc/services.d/promtail/run b/promtail/rootfs/etc/services.d/promtail/run similarity index 100% rename from addon-promtail-main/rootfs/etc/services.d/promtail/run rename to promtail/rootfs/etc/services.d/promtail/run From 6c9c70962c660550895bad7762a103f3408629dd Mon Sep 17 00:00:00 2001 From: mezned Date: Sun, 10 Nov 2024 10:32:23 +0100 Subject: [PATCH 02/29] update promtail --- promtail/Dockerfile | 21 +++++++++------------ promtail/build.yaml | 8 ++++---- 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/promtail/Dockerfile b/promtail/Dockerfile index 7c6712d..e0eb905 100644 --- a/promtail/Dockerfile +++ b/promtail/Dockerfile @@ -1,6 +1,3 @@ -# https://github.com/mdegat01/promtail-journal/releases -#FROM ghcr.io/mdegat01/promtail-journal/${BUILD_ARCH}:1.6.0 as build_promtail - # https://github.com/hassio-addons/addon-debian-base/releases # hadolint ignore=DL3006 ARG BUILD_FROM @@ -11,16 +8,17 @@ ARG YQ_VERSION=4.44.3 ARG BUILD_ARCH # Add yq and tzdata (required for the timestamp stage) -RUN echo "deb http://deb.debian.org/debian bullseye-backports main" >> /etc/apt/sources.list -RUN apt-get update && apt-get install -t bullseye-backports -qy libsystemd-dev RUN set -eux; \ - apt-get update; \ - apt-get install -qy --no-install-recommends \ - tar=1.34+dfsg-1 \ - ; \ - update-ca-certificates; \ + apk update; \ \ - case "${BUILD_ARCH}" in \ + apk add --no-cache --virtual .build-deps \ + libsystemd-dev \ + tar \ + ca-certificates \ + ; \ + APKARCH="$(apk --print-arch)"; \ +RUN update-ca-certificates; +RUN case "${BUILD_ARCH}" in \ amd64) BINARCH='amd64' ;; \ armhf) BINARCH='arm' ;; \ armv7) BINARCH='arm' ;; \ @@ -35,7 +33,6 @@ RUN set -eux; \ rm /tmp/yq.tar.gz; \ yq --version; \ \ - apt-get clean; \ rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*; \ chmod +x /etc/cont-init.d/promtail_setup.sh; \ chmod +x /etc/services.d/promtail/*; diff --git a/promtail/build.yaml b/promtail/build.yaml index be4d420..1a9f6a3 100644 --- a/promtail/build.yaml +++ b/promtail/build.yaml @@ -1,9 +1,9 @@ --- build_from: - amd64: ghcr.io/hassio-addons/debian-base/amd64:7.5.1 - armhf: ghcr.io/hassio-addons/debian-base/armhf:7.5.1 - armv7: ghcr.io/hassio-addons/debian-base/armv7:7.5.1 - aarch64: ghcr.io/hassio-addons/debian-base/aarch64:7.5.1 + amd64: ghcr.io/hassio-addons/base/amd64:16.3.4 + armhf: ghcr.io/hassio-addons/base/armhf:16.3.4 + armv7: ghcr.io/hassio-addons/base/armv7:16.3.4 + aarch64: ghcr.io/hassio-addons/base/aarch64:16.3.4 codenotary: base_image: codenotary@frenck.dev signer: codenotary@degatano.com From 6f048b8d7d3b80b94f477c3f32c65a9f52b68f3c Mon Sep 17 00:00:00 2001 From: mezned Date: Sun, 10 Nov 2024 10:35:27 +0100 Subject: [PATCH 03/29] update --- promtail/Dockerfile | 1 - 1 file changed, 1 deletion(-) diff --git a/promtail/Dockerfile b/promtail/Dockerfile index e0eb905..c7b6ed7 100644 --- a/promtail/Dockerfile +++ b/promtail/Dockerfile @@ -12,7 +12,6 @@ RUN set -eux; \ apk update; \ \ apk add --no-cache --virtual .build-deps \ - libsystemd-dev \ tar \ ca-certificates \ ; \ From 444ff9d492abe89540d28ffd1e332b9814fbfc6e Mon Sep 17 00:00:00 2001 From: mezned Date: Sun, 10 Nov 2024 10:41:05 +0100 Subject: [PATCH 04/29] update --- promtail/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/promtail/Dockerfile b/promtail/Dockerfile index c7b6ed7..8c80bc8 100644 --- a/promtail/Dockerfile +++ b/promtail/Dockerfile @@ -13,9 +13,9 @@ RUN set -eux; \ \ apk add --no-cache --virtual .build-deps \ tar \ - ca-certificates \ ; \ - APKARCH="$(apk --print-arch)"; \ +RUN apk add --no-cache \ + ca-certificates; RUN update-ca-certificates; RUN case "${BUILD_ARCH}" in \ amd64) BINARCH='amd64' ;; \ From 08f5edeffe2e975be194fdf4c9f185986a05afd5 Mon Sep 17 00:00:00 2001 From: mezned Date: Sun, 10 Nov 2024 10:43:28 +0100 Subject: [PATCH 05/29] update --- promtail/Dockerfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/promtail/Dockerfile b/promtail/Dockerfile index 8c80bc8..2bb300f 100644 --- a/promtail/Dockerfile +++ b/promtail/Dockerfile @@ -12,8 +12,7 @@ RUN set -eux; \ apk update; \ \ apk add --no-cache --virtual .build-deps \ - tar \ - ; \ + tar; RUN apk add --no-cache \ ca-certificates; RUN update-ca-certificates; From f25841fe59783d2a5440404a3c74931881280c7d Mon Sep 17 00:00:00 2001 From: mezned Date: Sun, 10 Nov 2024 10:45:16 +0100 Subject: [PATCH 06/29] update --- promtail/Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/promtail/Dockerfile b/promtail/Dockerfile index 2bb300f..52f2f56 100644 --- a/promtail/Dockerfile +++ b/promtail/Dockerfile @@ -7,6 +7,9 @@ FROM ${BUILD_FROM} ARG YQ_VERSION=4.44.3 ARG BUILD_ARCH + +COPY rootfs / + # Add yq and tzdata (required for the timestamp stage) RUN set -eux; \ apk update; \ @@ -39,7 +42,6 @@ RUN case "${BUILD_ARCH}" in \ COPY --from=grafana/promtail:latest /usr/bin/promtail /usr/bin/promtail RUN promtail --version -COPY rootfs / WORKDIR /data/promtail # Build arguments From 5a63674d309dc01b7ec6c4c8775a11624d74c699 Mon Sep 17 00:00:00 2001 From: mezned Date: Sun, 10 Nov 2024 10:50:28 +0100 Subject: [PATCH 07/29] update --- promtail/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/promtail/Dockerfile b/promtail/Dockerfile index 52f2f56..479f7ee 100644 --- a/promtail/Dockerfile +++ b/promtail/Dockerfile @@ -40,7 +40,7 @@ RUN case "${BUILD_ARCH}" in \ # Add promtail COPY --from=grafana/promtail:latest /usr/bin/promtail /usr/bin/promtail -RUN promtail --version +RUN /usr/bin/promtai --version WORKDIR /data/promtail From 72d51e70751101c5b9784e3e614b21083bb7c418 Mon Sep 17 00:00:00 2001 From: mezned Date: Sun, 10 Nov 2024 10:51:36 +0100 Subject: [PATCH 08/29] update --- promtail/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/promtail/Dockerfile b/promtail/Dockerfile index 479f7ee..2d20e79 100644 --- a/promtail/Dockerfile +++ b/promtail/Dockerfile @@ -40,7 +40,7 @@ RUN case "${BUILD_ARCH}" in \ # Add promtail COPY --from=grafana/promtail:latest /usr/bin/promtail /usr/bin/promtail -RUN /usr/bin/promtai --version +RUN /usr/bin/promtail --version WORKDIR /data/promtail From 294deebbcfd86ffc1170cb5d0e77d1c856da4743 Mon Sep 17 00:00:00 2001 From: mezned Date: Sun, 10 Nov 2024 11:04:35 +0100 Subject: [PATCH 09/29] update --- promtail/Dockerfile | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/promtail/Dockerfile b/promtail/Dockerfile index 2d20e79..17ea271 100644 --- a/promtail/Dockerfile +++ b/promtail/Dockerfile @@ -5,6 +5,7 @@ FROM ${BUILD_FROM} # https://github.com/mikefarah/yq/releases ARG YQ_VERSION=4.44.3 +ARG PROMTAIL_VERSION=3.2.1 ARG BUILD_ARCH @@ -39,7 +40,14 @@ RUN case "${BUILD_ARCH}" in \ chmod +x /etc/services.d/promtail/*; # Add promtail -COPY --from=grafana/promtail:latest /usr/bin/promtail /usr/bin/promtail +RUN apk add --no-cache curl tar && \ + curl -LO "https://github.com/grafana/loki/releases/download/v${PROMTAIL_VERSION}/promtail-linux-amd64.zip" && \ + apk add unzip && \ + unzip promtail-linux-amd64.zip && \ + mv promtail-linux-amd64 /usr/bin/promtai && \ + chmod +x /usr/bin/promtai && \ + rm promtail-linux-amd64.zip && \ + apk del unzip RUN /usr/bin/promtail --version WORKDIR /data/promtail From 0e5ee8d667faab5a2a1dec14316985d8ac3eefd8 Mon Sep 17 00:00:00 2001 From: mezned Date: Sun, 10 Nov 2024 11:07:05 +0100 Subject: [PATCH 10/29] update --- promtail/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/promtail/Dockerfile b/promtail/Dockerfile index 17ea271..4970781 100644 --- a/promtail/Dockerfile +++ b/promtail/Dockerfile @@ -44,8 +44,8 @@ RUN apk add --no-cache curl tar && \ curl -LO "https://github.com/grafana/loki/releases/download/v${PROMTAIL_VERSION}/promtail-linux-amd64.zip" && \ apk add unzip && \ unzip promtail-linux-amd64.zip && \ - mv promtail-linux-amd64 /usr/bin/promtai && \ - chmod +x /usr/bin/promtai && \ + mv promtail-linux-amd64 /usr/bin/promtail && \ + chmod +x /usr/bin/promtail && \ rm promtail-linux-amd64.zip && \ apk del unzip RUN /usr/bin/promtail --version From 125d48e626187d105ed4ed237c84ed65179b178c Mon Sep 17 00:00:00 2001 From: mezned Date: Sun, 10 Nov 2024 12:07:46 +0100 Subject: [PATCH 11/29] update --- promtail/Dockerfile | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/promtail/Dockerfile b/promtail/Dockerfile index 4970781..5e00562 100644 --- a/promtail/Dockerfile +++ b/promtail/Dockerfile @@ -40,14 +40,13 @@ RUN case "${BUILD_ARCH}" in \ chmod +x /etc/services.d/promtail/*; # Add promtail -RUN apk add --no-cache curl tar && \ - curl -LO "https://github.com/grafana/loki/releases/download/v${PROMTAIL_VERSION}/promtail-linux-amd64.zip" && \ - apk add unzip && \ - unzip promtail-linux-amd64.zip && \ - mv promtail-linux-amd64 /usr/bin/promtail && \ - chmod +x /usr/bin/promtail && \ - rm promtail-linux-amd64.zip && \ - apk del unzip +RUN apk add --no-cache curl tar unzip; \ + curl -LO "https://github.com/grafana/loki/releases/download/v${PROMTAIL_VERSION}/promtail-linux-amd64.zip"; \ + unzip promtail-linux-amd64.zip ; \ + mv promtail-linux-amd64 /usr/bin/promtail; \ + chmod +x /usr/bin/promtail; \ + rm promtail-linux-amd64.zip; \ + apk del unzip; RUN /usr/bin/promtail --version WORKDIR /data/promtail From 6d4ab6cc2c4205c791fdccea13ccd014d2669854 Mon Sep 17 00:00:00 2001 From: mezned Date: Sun, 10 Nov 2024 12:17:01 +0100 Subject: [PATCH 12/29] update --- promtail/Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/promtail/Dockerfile b/promtail/Dockerfile index 5e00562..1b50f6b 100644 --- a/promtail/Dockerfile +++ b/promtail/Dockerfile @@ -42,12 +42,12 @@ RUN case "${BUILD_ARCH}" in \ # Add promtail RUN apk add --no-cache curl tar unzip; \ curl -LO "https://github.com/grafana/loki/releases/download/v${PROMTAIL_VERSION}/promtail-linux-amd64.zip"; \ - unzip promtail-linux-amd64.zip ; \ + unzip promtail-linux-amd64.zip; \ mv promtail-linux-amd64 /usr/bin/promtail; \ chmod +x /usr/bin/promtail; \ rm promtail-linux-amd64.zip; \ - apk del unzip; -RUN /usr/bin/promtail --version + apk del unzip; \ + /usr/bin/promtail --version WORKDIR /data/promtail From 88d140dcf1bc3f3538d8239ecb35b604df95f706 Mon Sep 17 00:00:00 2001 From: mezned Date: Sun, 10 Nov 2024 12:25:25 +0100 Subject: [PATCH 13/29] update --- promtail/Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/promtail/Dockerfile b/promtail/Dockerfile index 1b50f6b..3f67047 100644 --- a/promtail/Dockerfile +++ b/promtail/Dockerfile @@ -43,7 +43,9 @@ RUN case "${BUILD_ARCH}" in \ RUN apk add --no-cache curl tar unzip; \ curl -LO "https://github.com/grafana/loki/releases/download/v${PROMTAIL_VERSION}/promtail-linux-amd64.zip"; \ unzip promtail-linux-amd64.zip; \ + ls ; \ mv promtail-linux-amd64 /usr/bin/promtail; \ + ls /usr/bin/promtail; \ chmod +x /usr/bin/promtail; \ rm promtail-linux-amd64.zip; \ apk del unzip; \ From 79ebd7f5110bff07cb564750ee2433b8aeb07b62 Mon Sep 17 00:00:00 2001 From: mezned Date: Sun, 10 Nov 2024 12:28:02 +0100 Subject: [PATCH 14/29] update --- promtail/Dockerfile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/promtail/Dockerfile b/promtail/Dockerfile index 3f67047..5ed05c4 100644 --- a/promtail/Dockerfile +++ b/promtail/Dockerfile @@ -47,9 +47,7 @@ RUN apk add --no-cache curl tar unzip; \ mv promtail-linux-amd64 /usr/bin/promtail; \ ls /usr/bin/promtail; \ chmod +x /usr/bin/promtail; \ - rm promtail-linux-amd64.zip; \ - apk del unzip; \ - /usr/bin/promtail --version + /usr/bin/promtail --version; WORKDIR /data/promtail From b53b68ac2ebfff4e76391115276680d4e29514cb Mon Sep 17 00:00:00 2001 From: mezned Date: Sun, 10 Nov 2024 12:29:47 +0100 Subject: [PATCH 15/29] update --- promtail/Dockerfile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/promtail/Dockerfile b/promtail/Dockerfile index 5ed05c4..d8aad4d 100644 --- a/promtail/Dockerfile +++ b/promtail/Dockerfile @@ -43,11 +43,9 @@ RUN case "${BUILD_ARCH}" in \ RUN apk add --no-cache curl tar unzip; \ curl -LO "https://github.com/grafana/loki/releases/download/v${PROMTAIL_VERSION}/promtail-linux-amd64.zip"; \ unzip promtail-linux-amd64.zip; \ - ls ; \ mv promtail-linux-amd64 /usr/bin/promtail; \ - ls /usr/bin/promtail; \ chmod +x /usr/bin/promtail; \ - /usr/bin/promtail --version; + rm promtail-linux-amd64.zip; WORKDIR /data/promtail From db382693199338e9f02729254e3ec2e9f52bab81 Mon Sep 17 00:00:00 2001 From: mezned Date: Sun, 10 Nov 2024 12:33:47 +0100 Subject: [PATCH 16/29] update --- promtail/Dockerfile | 4 ++-- promtail/rootfs/etc/services.d/promtail/run | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/promtail/Dockerfile b/promtail/Dockerfile index d8aad4d..bde5651 100644 --- a/promtail/Dockerfile +++ b/promtail/Dockerfile @@ -43,8 +43,8 @@ RUN case "${BUILD_ARCH}" in \ RUN apk add --no-cache curl tar unzip; \ curl -LO "https://github.com/grafana/loki/releases/download/v${PROMTAIL_VERSION}/promtail-linux-amd64.zip"; \ unzip promtail-linux-amd64.zip; \ - mv promtail-linux-amd64 /usr/bin/promtail; \ - chmod +x /usr/bin/promtail; \ + mv promtail-linux-amd64 /data/promtail; \ + chmod +x /data/promtail; \ rm promtail-linux-amd64.zip; WORKDIR /data/promtail diff --git a/promtail/rootfs/etc/services.d/promtail/run b/promtail/rootfs/etc/services.d/promtail/run index d5f6a71..813bcea 100644 --- a/promtail/rootfs/etc/services.d/promtail/run +++ b/promtail/rootfs/etc/services.d/promtail/run @@ -37,4 +37,4 @@ if [ "${log_level}" == "debug" ]; then fi bashio::log.info "Handing over control to Promtail..." -/usr/bin/promtail "${promtail_args[@]}" +/data/promtail "${promtail_args[@]}" From 5ecaf262ac10d5aa9721a175dc69bc2f1362921d Mon Sep 17 00:00:00 2001 From: mezned Date: Sun, 10 Nov 2024 12:36:14 +0100 Subject: [PATCH 17/29] update --- promtail/Dockerfile | 4 ++-- promtail/rootfs/etc/services.d/promtail/run | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/promtail/Dockerfile b/promtail/Dockerfile index bde5651..0d37b8b 100644 --- a/promtail/Dockerfile +++ b/promtail/Dockerfile @@ -43,8 +43,8 @@ RUN case "${BUILD_ARCH}" in \ RUN apk add --no-cache curl tar unzip; \ curl -LO "https://github.com/grafana/loki/releases/download/v${PROMTAIL_VERSION}/promtail-linux-amd64.zip"; \ unzip promtail-linux-amd64.zip; \ - mv promtail-linux-amd64 /data/promtail; \ - chmod +x /data/promtail; \ + mv promtail-linux-amd64 /data/promtail-cmd; \ + chmod +x /data/promtail-cmd; \ rm promtail-linux-amd64.zip; WORKDIR /data/promtail diff --git a/promtail/rootfs/etc/services.d/promtail/run b/promtail/rootfs/etc/services.d/promtail/run index 813bcea..dce15da 100644 --- a/promtail/rootfs/etc/services.d/promtail/run +++ b/promtail/rootfs/etc/services.d/promtail/run @@ -37,4 +37,4 @@ if [ "${log_level}" == "debug" ]; then fi bashio::log.info "Handing over control to Promtail..." -/data/promtail "${promtail_args[@]}" +/data/promtail-cmd "${promtail_args[@]}" From bdb1555ec47b29d75fff15af6ab54d6440c043cb Mon Sep 17 00:00:00 2001 From: mezned Date: Sun, 10 Nov 2024 17:52:32 +0100 Subject: [PATCH 18/29] update --- promtail/Dockerfile | 6 +++--- promtail/rootfs/etc/services.d/promtail/run | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/promtail/Dockerfile b/promtail/Dockerfile index 0d37b8b..c21db4f 100644 --- a/promtail/Dockerfile +++ b/promtail/Dockerfile @@ -42,9 +42,9 @@ RUN case "${BUILD_ARCH}" in \ # Add promtail RUN apk add --no-cache curl tar unzip; \ curl -LO "https://github.com/grafana/loki/releases/download/v${PROMTAIL_VERSION}/promtail-linux-amd64.zip"; \ - unzip promtail-linux-amd64.zip; \ - mv promtail-linux-amd64 /data/promtail-cmd; \ - chmod +x /data/promtail-cmd; \ + unzip promtail-linux-amd64.zip -d /usr/bin; \ + mv /usr/bin/promtail-linux-amd64 /usr/bin/promtail; \ + chmod a+x /usr/bin/promtail; \ rm promtail-linux-amd64.zip; WORKDIR /data/promtail diff --git a/promtail/rootfs/etc/services.d/promtail/run b/promtail/rootfs/etc/services.d/promtail/run index dce15da..d5f6a71 100644 --- a/promtail/rootfs/etc/services.d/promtail/run +++ b/promtail/rootfs/etc/services.d/promtail/run @@ -37,4 +37,4 @@ if [ "${log_level}" == "debug" ]; then fi bashio::log.info "Handing over control to Promtail..." -/data/promtail-cmd "${promtail_args[@]}" +/usr/bin/promtail "${promtail_args[@]}" From d96d0811fb2e304276378d00291a2fe0bbe682b0 Mon Sep 17 00:00:00 2001 From: mezned Date: Sun, 10 Nov 2024 18:00:39 +0100 Subject: [PATCH 19/29] update --- promtail/Dockerfile | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/promtail/Dockerfile b/promtail/Dockerfile index c21db4f..fa94a57 100644 --- a/promtail/Dockerfile +++ b/promtail/Dockerfile @@ -41,12 +41,17 @@ RUN case "${BUILD_ARCH}" in \ # Add promtail RUN apk add --no-cache curl tar unzip; \ - curl -LO "https://github.com/grafana/loki/releases/download/v${PROMTAIL_VERSION}/promtail-linux-amd64.zip"; \ + curl -s -J -L -o promtail-linux-amd64.zip + "https://github.com/grafana/loki/releases/download/v${PROMTAIL_VERSION}/promtail-linux-amd64.zip"; \ unzip promtail-linux-amd64.zip -d /usr/bin; \ mv /usr/bin/promtail-linux-amd64 /usr/bin/promtail; \ + ls -ltr /usr/bin/promtail; \ chmod a+x /usr/bin/promtail; \ - rm promtail-linux-amd64.zip; - + ls -ltr /usr/bin/promtail; \ + rm promtail-linux-amd64.zip; \ + ls -ltr /usr/bin/promtail; \ + /usr/bin/promtail -v; + WORKDIR /data/promtail # Build arguments From 462eeaaf1c7a6003d3442eedea259b42aef34b31 Mon Sep 17 00:00:00 2001 From: mezned Date: Sun, 10 Nov 2024 18:06:22 +0100 Subject: [PATCH 20/29] update --- promtail/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/promtail/Dockerfile b/promtail/Dockerfile index fa94a57..df73fcf 100644 --- a/promtail/Dockerfile +++ b/promtail/Dockerfile @@ -41,7 +41,7 @@ RUN case "${BUILD_ARCH}" in \ # Add promtail RUN apk add --no-cache curl tar unzip; \ - curl -s -J -L -o promtail-linux-amd64.zip + curl -s -J -L -o promtail-linux-amd64.zip \ "https://github.com/grafana/loki/releases/download/v${PROMTAIL_VERSION}/promtail-linux-amd64.zip"; \ unzip promtail-linux-amd64.zip -d /usr/bin; \ mv /usr/bin/promtail-linux-amd64 /usr/bin/promtail; \ From 97a0ab687cf8064acc05a370e1cd42323054970f Mon Sep 17 00:00:00 2001 From: mezned Date: Sun, 10 Nov 2024 18:11:24 +0100 Subject: [PATCH 21/29] hop last update --- promtail/Dockerfile | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/promtail/Dockerfile b/promtail/Dockerfile index df73fcf..5bf779d 100644 --- a/promtail/Dockerfile +++ b/promtail/Dockerfile @@ -39,18 +39,23 @@ RUN case "${BUILD_ARCH}" in \ chmod +x /etc/cont-init.d/promtail_setup.sh; \ chmod +x /etc/services.d/promtail/*; -# Add promtail -RUN apk add --no-cache curl tar unzip; \ - curl -s -J -L -o promtail-linux-amd64.zip \ - "https://github.com/grafana/loki/releases/download/v${PROMTAIL_VERSION}/promtail-linux-amd64.zip"; \ - unzip promtail-linux-amd64.zip -d /usr/bin; \ - mv /usr/bin/promtail-linux-amd64 /usr/bin/promtail; \ - ls -ltr /usr/bin/promtail; \ - chmod a+x /usr/bin/promtail; \ - ls -ltr /usr/bin/promtail; \ - rm promtail-linux-amd64.zip; \ - ls -ltr /usr/bin/promtail; \ - /usr/bin/promtail -v; +# Install necessary packages and glibc compatibility layer +RUN apk add --no-cache curl tar unzip && \ + curl -Lo /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub && \ + curl -Lo glibc.apk https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.35-r0/glibc-2.35-r0.apk && \ + apk add glibc.apk && \ + rm glibc.apk + +# Download and install Promtail +RUN curl -s -J -L -o promtail-linux-amd64.zip \ + "https://github.com/grafana/loki/releases/download/v${PROMTAIL_VERSION}/promtail-linux-amd64.zip" && \ + unzip promtail-linux-amd64.zip -d /usr/bin && \ + mv /usr/bin/promtail-linux-amd64 /usr/bin/promtail && \ + chmod a+x /usr/bin/promtail && \ + rm promtail-linux-amd64.zip + +# Verify Promtail installation +RUN /usr/bin/promtail -version WORKDIR /data/promtail From 36a8e795d9ccd33e9707370f2cf205567dd911c3 Mon Sep 17 00:00:00 2001 From: mezned Date: Sun, 10 Nov 2024 18:13:18 +0100 Subject: [PATCH 22/29] update --- promtail/Dockerfile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/promtail/Dockerfile b/promtail/Dockerfile index 5bf779d..dd587c8 100644 --- a/promtail/Dockerfile +++ b/promtail/Dockerfile @@ -39,9 +39,13 @@ RUN case "${BUILD_ARCH}" in \ chmod +x /etc/cont-init.d/promtail_setup.sh; \ chmod +x /etc/services.d/promtail/*; -# Install necessary packages and glibc compatibility layer +# Install necessary packages RUN apk add --no-cache curl tar unzip && \ + # Remove nsswitch.conf to avoid conflicts with glibc + rm -f /etc/nsswitch.conf && \ + # Add the public key for sgerrand glibc packages curl -Lo /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub && \ + # Download and install glibc curl -Lo glibc.apk https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.35-r0/glibc-2.35-r0.apk && \ apk add glibc.apk && \ rm glibc.apk From 55b501ccd23e8db84c2000380b0105bb7533fb3d Mon Sep 17 00:00:00 2001 From: mezned Date: Sun, 10 Nov 2024 18:17:17 +0100 Subject: [PATCH 23/29] update --- promtail/Dockerfile | 31 +++++++++++++------------------ 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/promtail/Dockerfile b/promtail/Dockerfile index dd587c8..2036b5a 100644 --- a/promtail/Dockerfile +++ b/promtail/Dockerfile @@ -39,26 +39,21 @@ RUN case "${BUILD_ARCH}" in \ chmod +x /etc/cont-init.d/promtail_setup.sh; \ chmod +x /etc/services.d/promtail/*; -# Install necessary packages -RUN apk add --no-cache curl tar unzip && \ - # Remove nsswitch.conf to avoid conflicts with glibc - rm -f /etc/nsswitch.conf && \ - # Add the public key for sgerrand glibc packages - curl -Lo /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub && \ - # Download and install glibc - curl -Lo glibc.apk https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.35-r0/glibc-2.35-r0.apk && \ - apk add glibc.apk && \ - rm glibc.apk +# Install dependencies for building Promtail +RUN apk add --no-cache go git build-base -# Download and install Promtail -RUN curl -s -J -L -o promtail-linux-amd64.zip \ - "https://github.com/grafana/loki/releases/download/v${PROMTAIL_VERSION}/promtail-linux-amd64.zip" && \ - unzip promtail-linux-amd64.zip -d /usr/bin && \ - mv /usr/bin/promtail-linux-amd64 /usr/bin/promtail && \ - chmod a+x /usr/bin/promtail && \ - rm promtail-linux-amd64.zip +# Download the Promtail source code +RUN git clone --branch "v${PROMTAIL_VERSION}" https://github.com/grafana/loki.git /promtail-src -# Verify Promtail installation +# Build Promtail +WORKDIR /promtail-src/clients/cmd/promtail +RUN go build -o /usr/bin/promtail + +# Clean up source and unnecessary packages +RUN apk del go git build-base && \ + rm -rf /promtail-src + +# Verify the installation RUN /usr/bin/promtail -version WORKDIR /data/promtail From 85425c19de2f16b60c1c5411d8f2922a24e7ac45 Mon Sep 17 00:00:00 2001 From: mezned Date: Sun, 10 Nov 2024 20:53:27 +0100 Subject: [PATCH 24/29] Update loki/rootfs/etc/loki/default-config.yaml --- loki/rootfs/etc/loki/default-config.yaml | 54 +++++++++--------------- 1 file changed, 21 insertions(+), 33 deletions(-) diff --git a/loki/rootfs/etc/loki/default-config.yaml b/loki/rootfs/etc/loki/default-config.yaml index cee11a4..06b02ae 100644 --- a/loki/rootfs/etc/loki/default-config.yaml +++ b/loki/rootfs/etc/loki/default-config.yaml @@ -1,45 +1,33 @@ ---- + +# This is a complete configuration to deploy Loki backed by the filesystem. +# The index will be shipped to the storage via tsdb-shipper. + auth_enabled: false -server: {} +server: + http_listen_port: 3100 -ingester: - lifecycler: - address: 127.0.0.1 - ring: - kvstore: - store: inmemory - replication_factor: 1 - final_sleep: 0s - chunk_idle_period: 1h - max_chunk_age: 1h - chunk_target_size: 1048576 - chunk_retain_period: 30s - wal: - dir: /data/loki/wal +common: + ring: + instance_addr: 127.0.0.1 + kvstore: + store: inmemory + replication_factor: 1 + path_prefix: /tmp/loki schema_config: configs: - - from: 2020-11-09 - store: tsdb # Changed to tsdb - object_store: filesystem - schema: v13 # Changed to v13 - index: - prefix: index_ - period: 24h + - from: 2020-05-15 + store: tsdb + object_store: filesystem + schema: v13 + index: + prefix: index_ + period: 24h storage_config: - tsdb_shipper: - active_index_directory: /data/loki/tsdb-active # Set this path - cache_location: /data/loki/tsdb-cache # Set this path filesystem: - directory: /data/loki/chunks - -compactor: - working_directory: /data/loki/boltdb-shipper-compactor - retention_enabled: true - delete_request_store: filesystem # Added this line - + directory: /tmp/loki/chunks limits_config: reject_old_samples: true reject_old_samples_max_age: 168h From 51e21d52406dfbea0a3b004409d62ecdb92eded7 Mon Sep 17 00:00:00 2001 From: mezned Date: Sun, 10 Nov 2024 21:58:29 +0100 Subject: [PATCH 25/29] Update promtail/rootfs/etc/promtail/default-scrape-config.yaml --- .../etc/promtail/default-scrape-config.yaml | 34 +++++-------------- 1 file changed, 8 insertions(+), 26 deletions(-) diff --git a/promtail/rootfs/etc/promtail/default-scrape-config.yaml b/promtail/rootfs/etc/promtail/default-scrape-config.yaml index 6e3f112..93224eb 100644 --- a/promtail/rootfs/etc/promtail/default-scrape-config.yaml +++ b/promtail/rootfs/etc/promtail/default-scrape-config.yaml @@ -1,27 +1,9 @@ --- -- job_name: journal - journal: - json: false - max_age: 12h - labels: - job: systemd-journal - path: "${JOURNAL_PATH}" - relabel_configs: - - source_labels: - - __journal__systemd_unit - target_label: unit - - source_labels: - - __journal__hostname - target_label: nodename - - source_labels: - - __journal_syslog_identifier - target_label: syslog_identifier - - source_labels: - - __journal_container_name - target_label: container_name - pipeline_stages: - - match: - selector: '{container_name=~"homeassistant|hassio_supervisor"}' - stages: - - multiline: - firstline: '^\x{001b}' +job_name: home_assistant_logs + static_configs: + - targets: + - localhost # Target for the logs, can be anything since it's just a label + labels: + job: home_assistant # Job label for your logs in Loki + host: home_assistant # Optional label for host, useful if running multiple Home Assistant instances + __path__: /config/home-assistant.log # Path to Home Assistant log file \ No newline at end of file From 1b28894e97bc3675f4687f92b989cd8194b08e5e Mon Sep 17 00:00:00 2001 From: mezned Date: Sun, 10 Nov 2024 21:59:34 +0100 Subject: [PATCH 26/29] Update promtail/rootfs/etc/promtail/default-scrape-config.yaml --- .../etc/promtail/default-scrape-config.yaml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/promtail/rootfs/etc/promtail/default-scrape-config.yaml b/promtail/rootfs/etc/promtail/default-scrape-config.yaml index 93224eb..8520214 100644 --- a/promtail/rootfs/etc/promtail/default-scrape-config.yaml +++ b/promtail/rootfs/etc/promtail/default-scrape-config.yaml @@ -1,9 +1,9 @@ --- -job_name: home_assistant_logs - static_configs: - - targets: - - localhost # Target for the logs, can be anything since it's just a label - labels: - job: home_assistant # Job label for your logs in Loki - host: home_assistant # Optional label for host, useful if running multiple Home Assistant instances - __path__: /config/home-assistant.log # Path to Home Assistant log file \ No newline at end of file +- job_name: home_assistant_logs + static_configs: + - targets: + - localhost # Target for the logs, can be anything since it's just a label + labels: + job: home_assistant # Job label for your logs in Loki + host: home_assistant # Optional label for host, useful if running multiple Home Assistant instances + __path__: /config/home-assistant.log # Path to Home Assistant log file \ No newline at end of file From 0c94589edf5d30837ac234141f079043ac93e236 Mon Sep 17 00:00:00 2001 From: mezned Date: Sun, 10 Nov 2024 22:09:26 +0100 Subject: [PATCH 27/29] Update promtail/config.yaml --- promtail/config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/promtail/config.yaml b/promtail/config.yaml index 30fba64..2e6219a 100644 --- a/promtail/config.yaml +++ b/promtail/config.yaml @@ -13,8 +13,8 @@ codenotary: codenotary@degatano.com init: false journald: true map: - - config - - share + - config:rw + - share:rw - ssl watchdog: http://[HOST]:[PORT:9080]/ready ports: From 3470a6e1bdea478d188308d1dc2205933f9cb13e Mon Sep 17 00:00:00 2001 From: mezned Date: Sun, 10 Nov 2024 22:34:41 +0100 Subject: [PATCH 28/29] Update promtail/config.yaml --- promtail/config.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/promtail/config.yaml b/promtail/config.yaml index 2e6219a..3415ac1 100644 --- a/promtail/config.yaml +++ b/promtail/config.yaml @@ -11,7 +11,6 @@ arch: description: Promtail for Home Assistant codenotary: codenotary@degatano.com init: false -journald: true map: - config:rw - share:rw From f2e1eab4c0d7c4906b4523bd9e601f69c9a0717c Mon Sep 17 00:00:00 2001 From: mezned Date: Mon, 11 Nov 2024 09:53:30 +0100 Subject: [PATCH 29/29] Update promtail/config.yaml --- promtail/config.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/promtail/config.yaml b/promtail/config.yaml index 3415ac1..899bdef 100644 --- a/promtail/config.yaml +++ b/promtail/config.yaml @@ -11,6 +11,12 @@ arch: description: Promtail for Home Assistant codenotary: codenotary@degatano.com init: false +hassio_api: true +homeassistant_api: true +auth_api: true +docker_api: true +host_network: true +host_pid: true map: - config:rw - share:rw