diff --git a/.drone/drone.jsonnet b/.drone/drone.jsonnet index 49bdce8787cc9..a4120d0efc57e 100644 --- a/.drone/drone.jsonnet +++ b/.drone/drone.jsonnet @@ -918,6 +918,7 @@ local manifest_ecr(apps, archs) = pipeline('manifest-ecr') { }, commands: [ 'make docker-driver-push', + 'make docker-driver-push PLUGIN_ARCH=-arm64', ], volumes: [ { diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e81ef43a3899..465d2cfdd4bfc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ * [10380](https://github.com/grafana/loki/pull/10380) **shantanualsi** Remove `experimental.ruler.enable-api` in favour of `ruler.enable-api` * [10395](https://github.com/grafana/loki/pull/10395/) **shantanualshi** Remove deprecated `split_queries_by_interval` and `forward_headers_list` configuration options in the `query_range` section * [10456](https://github.com/grafana/loki/pull/10456) **dannykopping** Add `loki_distributor_ingester_append_timeouts_total` metric, remove `loki_distributor_ingester_append_failures_total` metric +* [9247](https://github.com/grafana/loki/pull/9247) **tucksaun**: Build the Docker driver for arm64 ##### Fixes diff --git a/Makefile b/Makefile index d7e693561a417..6fd806d1d7b7d 100644 --- a/Makefile +++ b/Makefile @@ -421,13 +421,18 @@ endif LOKI_DOCKER_DRIVER ?= "grafana/loki-docker-driver" PLUGIN_TAG ?= $(IMAGE_TAG) PLUGIN_ARCH ?= +ifeq ("$(PLUGIN_ARCH)", "-arm64") + PLUGIN_BUILD_ARGS = --build-arg GOARCH=arm64 +else + PLUGIN_BUILD_ARGS = +endif # build-rootfs # builds the plugin rootfs define build-rootfs rm -rf clients/cmd/docker-driver/rootfs || true mkdir clients/cmd/docker-driver/rootfs - docker build -t rootfsimage -f clients/cmd/docker-driver/Dockerfile . + docker build $(PLUGIN_BUILD_ARGS) -t rootfsimage -f clients/cmd/docker-driver/Dockerfile . ID=$$(docker create rootfsimage true) && \ (docker export $$ID | tar -x -C clients/cmd/docker-driver/rootfs) && \ diff --git a/clients/cmd/docker-driver/Dockerfile b/clients/cmd/docker-driver/Dockerfile index cbec3f377ff08..7ff7400ba31ee 100644 --- a/clients/cmd/docker-driver/Dockerfile +++ b/clients/cmd/docker-driver/Dockerfile @@ -1,16 +1,25 @@ ARG BUILD_IMAGE=grafana/loki-build-image:0.29.3 +ARG GOARCH=amd64 # Directories in this file are referenced from the root of the project not this folder # This file is intended to be called from the root like so: -# docker build -t grafana/loki -f cmd/loki/Dockerfile . +# docker build -t grafana/loki-docker-driver -f clients/cmd/docker-driver/Dockerfile . -# TODO: add cross-platform support FROM $BUILD_IMAGE as build COPY . /src/loki WORKDIR /src/loki RUN make clean && make BUILD_IN_CONTAINER=false clients/cmd/docker-driver/docker-driver -FROM alpine:3.16.7 -RUN apk add --update --no-cache ca-certificates tzdata +FROM alpine:3.16.7 as temp + +RUN apk add --update --no-cache --arch=${GOARCH} ca-certificates tzdata + +FROM --platform=linux/${GOARCH} alpine:3.16.7 + +COPY --from=temp /etc/ca-certificates.conf /etc/ca-certificates.conf +COPY --from=temp /usr/share/ca-certificates /usr/share/ca-certificates +COPY --from=temp /usr/share/zoneinfo /usr/share/zoneinfo + COPY --from=build /src/loki/clients/cmd/docker-driver/docker-driver /bin/docker-driver + WORKDIR /bin/ ENTRYPOINT [ "/bin/docker-driver" ] diff --git a/docs/sources/send-data/docker-driver/_index.md b/docs/sources/send-data/docker-driver/_index.md index f72d9d8c01ac2..bbbef19644307 100644 --- a/docs/sources/send-data/docker-driver/_index.md +++ b/docs/sources/send-data/docker-driver/_index.md @@ -31,6 +31,9 @@ Run the following command to install the plugin, updating the release version if ```bash docker plugin install grafana/loki-docker-driver:2.8.2 --alias loki --grant-all-permissions ``` +{{% admonition type="note" %}} +Add `-arm64` to the image tag for AMR64 hosts. +{{% /admonition %}} To check installed plugins, use the `docker plugin ls` command. Plugins that have started successfully are listed as enabled: