forked from grafana/loki
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
**What this PR does / why we need it**: Add ARM64 build and release of the Docker driver in Drone pipeline **Which issue(s) this PR fixes**: Fixes grafana#5682 **Special notes for your reviewer**: I would have loved to have a unified x64 and arm64 build but apparently Docker drivers does not support multi arch images. So instead I went with tweaking the build steps to allow cross building the image for ARM64 and added the instructions to do so in `drone.yml`. **Checklist** - [x] Reviewed the [`CONTRIBUTING.md`](https://github.com/grafana/loki/blob/main/CONTRIBUTING.md) guide (**required**) - [x] Documentation added - [ ] Tests updated - [ ] Changes that require user attention or interaction to upgrade are documented in `docs/sources/upgrading/_index.md`
- Loading branch information
Showing
3 changed files
with
27 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,29 @@ | ||
ARG BUILD_IMAGE=grafana/loki-build-image:0.34.0 | ||
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.20.3 | ||
RUN apk add --update --no-cache ca-certificates tzdata | ||
ARG GOARCH | ||
RUN make clean && make BUILD_IN_CONTAINER=false GOARCH=${GOARCH} clients/cmd/docker-driver/docker-driver | ||
|
||
FROM alpine:3.20.3 AS temp | ||
|
||
ARG GOARCH | ||
|
||
RUN apk add --update --no-cache --arch=${GOARCH} ca-certificates tzdata | ||
|
||
FROM --platform=linux/${GOARCH} alpine:3.20.3 | ||
|
||
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" ] |
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