-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix 32-bit Promtail ARM docker builds from Drone (#1740)
* link ld-linux-armhf.so.3 when building 32-bit arm promtail image if needed * Update .drone/drone.jsonnet Co-Authored-By: sh0rez <me@shorez.de> * review feedback Co-authored-by: sh0rez <me@shorez.de>
- Loading branch information
Showing
3 changed files
with
56 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
FROM golang:1.13 as build | ||
# TOUCH_PROTOS signifies if we should touch the compiled proto files and thus not regenerate them. | ||
# This is helpful when file system timestamps can't be trusted with make | ||
ARG TOUCH_PROTOS | ||
COPY . /src/loki | ||
WORKDIR /src/loki | ||
RUN apt-get update && apt-get install -qy libsystemd-dev | ||
RUN make clean && (if [ "${TOUCH_PROTOS}" ]; then make touch-protos; fi) && make BUILD_IN_CONTAINER=false promtail | ||
|
||
# Promtail requires debian as the base image to support systemd journal reading | ||
FROM debian:stretch-slim | ||
# tzdata required for the timestamp stage to work | ||
RUN apt-get update && \ | ||
apt-get install -qy \ | ||
tzdata ca-certificates libsystemd-dev && \ | ||
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* | ||
COPY --from=build /src/loki/cmd/promtail/promtail /usr/bin/promtail | ||
COPY cmd/promtail/promtail-local-config.yaml /etc/promtail/local-config.yaml | ||
COPY cmd/promtail/promtail-docker-config.yaml /etc/promtail/docker-config.yaml | ||
|
||
# Drone CI builds arm32 images using armv8l rather than armv7l. Something in | ||
# our build process above causes ldconfig to be rerun and removes the armhf | ||
# library that debian:stretch-slim on ARM comes with. Symbolically linking to | ||
# ld-linux.so.3 fixes the problem and allows Promtail to start. | ||
# | ||
# This process isn't necessary when building on armv7l so we only do it if the | ||
# library was removed. | ||
RUN sh -c '[ ! -f /lib/ld-linux-armhf.so.3 ] && echo RE-LINKING LD-LINUX-ARMHF.SO.3 && ln -s /lib/ld-linux.so.3 /lib/ld-linux-armhf.so.3' | ||
|
||
ENTRYPOINT ["/usr/bin/promtail"] |