From 39ef193faef0e8309f3f7bfceb5cc3f17d5bf8fa Mon Sep 17 00:00:00 2001 From: Lukas Fittl Date: Tue, 3 Oct 2023 01:12:52 -0700 Subject: [PATCH] Docker log tail: Re-order args to also support podman aliased as docker Whilst we currently explicitly call out to "docker" for this experimental way of reading local logs during development, we technically also support podman when its available with the "docker" alias. However, podman requires arguments to be set before the container name. Fix support for this type of setup. This keeps compatibility with docker, which accepts arguments in either order. --- input/system/selfhosted/logs.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/input/system/selfhosted/logs.go b/input/system/selfhosted/logs.go index 8f3334ea8..a00cabd3d 100644 --- a/input/system/selfhosted/logs.go +++ b/input/system/selfhosted/logs.go @@ -340,7 +340,7 @@ func setupLogLocationTail(ctx context.Context, logLocation string, out chan<- Se func setupDockerTail(ctx context.Context, containerName string, out chan<- SelfHostedLogStreamItem, prefixedLogger *util.Logger) error { var err error - cmd := exec.Command("docker", "logs", containerName, "-f", "--tail", "0") + cmd := exec.Command("docker", "logs", "-f", "--tail", "0", containerName) stderr, _ := cmd.StderrPipe() scanner := bufio.NewScanner(stderr)