github.com/yankunsam/loki/v2@v2.6.3-0.20220817130409-389df5235c27/clients/cmd/promtail/Dockerfile.debug (about) 1 # Directories in this file are referenced from the root of the project not this folder 2 # This file is intended to be called from the root like so: 3 # docker build -t grafana/promtail -f clients/cmd/promtail/Dockerfile.debug . 4 5 FROM grafana/loki-build-image as build 6 ARG GOARCH="amd64" 7 COPY . /src/loki 8 WORKDIR /src/loki 9 RUN make clean && make BUILD_IN_CONTAINER=false promtail-debug 10 11 12 FROM alpine:3.15.4 13 RUN apk add --update --no-cache ca-certificates tzdata 14 COPY --from=build /src/loki/clients/cmd/promtail/promtail-debug /usr/bin/promtail-debug 15 COPY --from=build /go/bin/dlv /usr/bin/dlv 16 COPY clients/cmd/promtail/promtail-local-config.yaml /etc/promtail/local-config.yaml 17 COPY clients/cmd/promtail/promtail-docker-config.yaml /etc/promtail/config.yml 18 19 # Expose 40000 for delve 20 EXPOSE 40000 21 22 # Allow delve to run on Alpine based containers. 23 RUN apk add --no-cache libc6-compat 24 25 # Run delve, ending with -- because we pass params via kubernetes, per the docs: 26 # Pass flags to the program you are debugging using --, for example:` 27 # dlv exec ./hello -- server --config conf/config.toml` 28 ENTRYPOINT ["/usr/bin/dlv", "--listen=:40000", "--headless=true", "--api-version=2", "exec", "/usr/bin/promtail-debug", "--"] 29 CMD ["-config.file=/etc/promtail/config.yml"]