github.com/yankunsam/loki/v2@v2.6.3-0.20220817130409-389df5235c27/clients/cmd/promtail/Dockerfile.cross (about) 1 ARG BUILD_IMAGE=grafana/loki-build-image:0.18.0 2 # Directories in this file are referenced from the root of the project not this folder 3 # This file is intended to be called from the root like so: 4 # docker build -t grafana/promtail -f clients/cmd/promtail/Dockerfile . 5 FROM golang:1.18.4-alpine as goenv 6 RUN go env GOARCH > /goarch && \ 7 go env GOARM > /goarm 8 9 FROM --platform=linux/amd64 $BUILD_IMAGE as build 10 COPY --from=goenv /goarch /goarm / 11 COPY . /src/loki 12 WORKDIR /src/loki 13 RUN make clean && GOARCH=$(cat /goarch) GOARM=$(cat /goarm) make BUILD_IN_CONTAINER=false promtail 14 15 # Promtail requires debian as the base image to support systemd journal reading 16 FROM debian:stretch-slim 17 # tzdata required for the timestamp stage to work 18 RUN apt-get update && \ 19 apt-get install -qy \ 20 tzdata ca-certificates libsystemd-dev && \ 21 rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 22 COPY --from=build /src/loki/clients/cmd/promtail/promtail /usr/bin/promtail 23 COPY clients/cmd/promtail/promtail-local-config.yaml /etc/promtail/local-config.yaml 24 COPY clients/cmd/promtail/promtail-docker-config.yaml /etc/promtail/config.yml 25 ENTRYPOINT ["/usr/bin/promtail"] 26 CMD ["-config.file=/etc/promtail/config.yml"]