From 4779b8bd2bedfeef59f049f080f34f8110998297 Mon Sep 17 00:00:00 2001
From: sh0rez <me@shorez.de>
Date: Mon, 8 Jul 2019 16:13:17 +0200
Subject: [PATCH] fix(loki): panic on missing config (#720)

* fix(loki): pass missing config error to user

Missing config errors are handled at the library level. Our own check mitigated
this and causes loki to SEGFAULT later on

* feat(loki): default config file in container

The container provides a default config file. Use it by default

* Revert "fix(loki): pass missing config error to user"

This reverts commit b2744fcf427b2b386dce5e999c855ae5c899e4e2, because loki it
assumed loki was incapable of running without config, which is not the case.
---
 cmd/loki/Dockerfile       | 1 +
 cmd/loki/Dockerfile.debug | 1 +
 2 files changed, 2 insertions(+)

diff --git a/cmd/loki/Dockerfile b/cmd/loki/Dockerfile
index feb074da..7a7ec4cc 100644
--- a/cmd/loki/Dockerfile
+++ b/cmd/loki/Dockerfile
@@ -4,3 +4,4 @@ COPY       loki /bin/loki
 COPY       loki-local-config.yaml /etc/loki/local-config.yaml
 EXPOSE     80
 ENTRYPOINT [ "/bin/loki" ]
+CMD        ["-config.file=/etc/loki/local-config.yaml"]
diff --git a/cmd/loki/Dockerfile.debug b/cmd/loki/Dockerfile.debug
index ca4c61f8..654a1e3f 100644
--- a/cmd/loki/Dockerfile.debug
+++ b/cmd/loki/Dockerfile.debug
@@ -15,3 +15,4 @@ RUN apk add --no-cache libc6-compat
 #   Pass flags to the program you are debugging using --, for example:`
 #   dlv exec ./hello -- server --config conf/config.toml`
 ENTRYPOINT ["/usr/bin/dlv", "--listen=:40000", "--headless=true", "--api-version=2", "exec", "/bin/loki-debug", "--"]
+CMD        ["-config.file=/etc/loki/local-config.yaml"]
-- 
GitLab