From 0ee887c57fb9306711d7dadc81edf84fe8fa0d55 Mon Sep 17 00:00:00 2001 From: Sas Swart Date: Sun, 6 Feb 2022 11:11:29 +0200 Subject: [PATCH] Add goyacc to logcli and loki-canary Dockerfiles --- cmd/logcli/Dockerfile | 12 ++++++++++++ cmd/loki-canary/Dockerfile | 12 ++++++++++++ 2 files changed, 24 insertions(+) diff --git a/cmd/logcli/Dockerfile b/cmd/logcli/Dockerfile index 70598177de..143acb061d 100644 --- a/cmd/logcli/Dockerfile +++ b/cmd/logcli/Dockerfile @@ -2,6 +2,18 @@ FROM golang:1.17.2 as build COPY . /src/loki WORKDIR /src/loki + +# Copying this from loki-build-image/Dockerfile +# because these dependencies are required by the Makefile in certain +# circumstances. This should be removed and the base image above changed +# from golang to loki-build-image once the latter becomes available for arm. +RUN GO111MODULE=on go install \ + # Due to the lack of a proper release tag, we use the commit hash of + # https://github.com/golang/tools/releases v0.1.7 + golang.org/x/tools/cmd/goyacc@58d531046acdc757f177387bc1725bfa79895d69 && \ + rm -rf /go/pkg /go/src +ENV GOCACHE=/go/cache + RUN make clean && make BUILD_IN_CONTAINER=false logcli FROM alpine:3.13 diff --git a/cmd/loki-canary/Dockerfile b/cmd/loki-canary/Dockerfile index 7faa6450ef..b30baec02b 100644 --- a/cmd/loki-canary/Dockerfile +++ b/cmd/loki-canary/Dockerfile @@ -2,6 +2,18 @@ FROM golang:1.17.2 as build COPY . /src/loki WORKDIR /src/loki + +# Copying this from loki-build-image/Dockerfile +# because these dependencies are required by the Makefile in certain +# circumstances. This should be removed and the base image above changed +# from golang to loki-build-image once the latter becomes available for arm. +RUN GO111MODULE=on go install \ + # Due to the lack of a proper release tag, we use the commit hash of + # https://github.com/golang/tools/releases v0.1.7 + golang.org/x/tools/cmd/goyacc@58d531046acdc757f177387bc1725bfa79895d69 && \ + rm -rf /go/pkg /go/src +ENV GOCACHE=/go/cache + RUN make clean && make BUILD_IN_CONTAINER=false loki-canary FROM alpine:3.13