When I run tail -f in the background and docker exec -it in the foreground, the outputs of tail-command are corrupted.
For example, when I run the following commands:
$ tail -f log.txt &
$ docker exec -it my-container /bin/bash
and I append the following 3 lines to log.txt:
cat
dog
bird
then I get the following strange outputs:
root@4083b121d1793:~# cat
dog
bird
Notice the line breaks. I'm guessing carriage returns are not applied.
Why does this strange behavior occur? Is there any solution?
Update
Versoins:
- Docker Desktop for Mac 3.2.1
- Docker Engine 20.10.5