Pipe docker logs -f into jq

Try adding --unbuffered --stream so your command becomes

docker logs -f container_id 2>&1 | jq --unbuffered --stream '.'

It seems many other people have had a similar problem. Here are some bug reports on jq about this topic

  • https://github.com/stedolan/jq/issues/477
  • https://github.com/stedolan/jq/issues/1530