From dd2bf2a7161967e2410124ccef522e05134614e8 Mon Sep 17 00:00:00 2001 From: Robert Fratto Date: Fri, 8 Jan 2021 13:31:12 -0500 Subject: [PATCH] Update libsystemd version in Docker containers (#258) * Use a newer libsystemd in Docker containers Corresponds to grafana/loki#2957 * changelog * merge apt-get commands to create less layers --- CHANGELOG.md | 17 ++++++++++------- cmd/agent/Dockerfile | 17 ++++++++++++----- cmd/agent/Dockerfile.buildx | 9 ++++++--- 3 files changed, 28 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 64dced2c1cf3..5bd41450d7f3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,13 +10,6 @@ this platform. FreeBSD builds will return in a future release. - [ENHANCEMENT] `process-exporter` has been updated to v0.7.5. (@rfratto) -- [BUGFIX] Integrations will now function if the HTTP listen address was set to - a value other than the default. ([#206](https://github.com/grafana/agent/issues/206)) (@mattdurham) - -- [BUGFIX] The default Loki installation will now be able to write its positions - file. This was prevented by accidentally writing to a readonly volume mount. - (@rfratto) - - [ENHANCEMENT] `wal_cleanup_age` and `wal_cleanup_period` have been added to the top-level Prometheus configuration section. These settings control how Write Ahead Logs (WALs) that are not associated with any instances are cleaned up. By default, @@ -24,6 +17,16 @@ this platform. FreeBSD builds will return in a future release. are eligible to be cleaned up. This cleanup can be disabled by setting `wal_cleanup_period` to `0`. (#304) (@56quarters) +- [ENHANCEMENT] Configuring logs to read from the systemd journal should now + work on journals that use +ZSTD compression. (@rfratto) + +- [BUGFIX] Integrations will now function if the HTTP listen address was set to + a value other than the default. ([#206](https://github.com/grafana/agent/issues/206)) (@mattdurham) + +- [BUGFIX] The default Loki installation will now be able to write its positions + file. This was prevented by accidentally writing to a readonly volume mount. + (@rfratto) + # v0.9.1 (2021-01-04) NOTE: FreeBSD builds will not be included for this release. There is a bug in an diff --git a/cmd/agent/Dockerfile b/cmd/agent/Dockerfile index 006ac96754b1..731409543e34 100644 --- a/cmd/agent/Dockerfile +++ b/cmd/agent/Dockerfile @@ -1,16 +1,23 @@ -FROM golang:1.15 as build +FROM golang:1.15.3-buster as build COPY . /src/agent WORKDIR /src/agent ARG RELEASE_BUILD=true ARG IMAGE_TAG -RUN apt-get update && apt-get install -qy libsystemd-dev + +# Backports repo required to get a libsystemd version 246 or newer which is required to handle journal +ZSTD compression +RUN echo "deb http://deb.debian.org/debian buster-backports main" >> /etc/apt/sources.list +RUN apt-get update && apt-get install -t buster-backports -qy libsystemd-dev + RUN make clean && make IMAGE_TAG=${IMAGE_TAG} RELEASE_BUILD=${RELEASE_BUILD} BUILD_IN_CONTAINER=false agent FROM debian:buster-slim -RUN apt-get update && \ - apt-get install -qy \ - tzdata ca-certificates libsystemd-dev && \ + +# Backports repo required to get a libsystemd version 246 or newer which is required to handle journal +ZSTD compression +RUN echo "deb http://deb.debian.org/debian buster-backports main" >> /etc/apt/sources.list +RUN apt-get update && apt-get install -t buster-backports -qy libsystemd-dev && \ + apt-get install -qy tzdata ca-certificates && \ rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* + COPY --from=build /src/agent/cmd/agent/agent /bin/agent COPY cmd/agent/agent-local-config.yaml /etc/agent/agent.yaml diff --git a/cmd/agent/Dockerfile.buildx b/cmd/agent/Dockerfile.buildx index 62edf9b7ad4e..a32226ab8d3a 100644 --- a/cmd/agent/Dockerfile.buildx +++ b/cmd/agent/Dockerfile.buildx @@ -13,10 +13,13 @@ RUN cp /go_wrapper.sh /seego.sh RUN make clean && IMAGE_TAG=${IMAGE_TAG} RELEASE_BUILD=${RELEASE_BUILD} BUILD_IN_CONTAINER=false bash ./tools/cross_build.bash agent FROM debian:buster-slim -RUN apt-get update && \ - apt-get install -qy \ - tzdata ca-certificates libsystemd-dev && \ + +# Backports repo required to get a libsystemd version 246 or newer which is required to handle journal +ZSTD compression +RUN echo "deb http://deb.debian.org/debian buster-backports main" >> /etc/apt/sources.list +RUN apt-get update && apt-get install -t buster-backports -qy libsystemd-dev && \ + apt-get install -qy tzdata ca-certificates libsystemd-dev && \ rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* + COPY --from=build /src/agent/cmd/agent/agent /bin/agent COPY cmd/agent/agent-local-config.yaml /etc/agent/agent.yaml