Docker: How to clear the logs properly for a Docker container?

First the bad answer. From this question there’s a one-liner that you can run: echo “” > $(docker inspect –format=”{{.LogPath}}” <container_name_or_id>) instead of echo, there’s the simpler: : > $(docker inspect –format=”{{.LogPath}}” <container_name_or_id>) or there’s the truncate command: truncate -s 0 $(docker inspect –format=”{{.LogPath}}” <container_name_or_id>) I’m not a big fan of either of those since … Read more