Fix printing docker container logs

Currently, we observe non-readable artefacts in the beginning of each
log line from docker container because log stream prints logs in
multiplexed way and first 8 bytes is actually a header by default. This
patch fixes this issue by using TTY mode (in this case output data
is copied directly from the container output stream, no extra
multiplexing or headers)[1].

[1] https://godoc.org/github.com/docker/docker/client#Client.ContainerLogs

Change-Id: I26f1588936be736a124b9c77ed712ac4376f03a2
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
This commit is contained in:
Ruslan Aliev 2020-09-23 03:06:31 -05:00
parent 0c736af2e8
commit 09ffae277b
1 changed files with 1 additions and 0 deletions

View File

@ -175,6 +175,7 @@ func (c *DockerContainer) getConfig(
AttachStdin: true,
OpenStdin: true,
Env: envVars,
Tty: true,
}
hCfg := container.HostConfig{
Binds: volumeMounts,