Skip to content

Instantly share code, notes, and snippets.

@reilee
Created May 8, 2020 02:59
Show Gist options
  • Save reilee/992561a7e22f0db7322143e9c17fb3bd to your computer and use it in GitHub Desktop.
Save reilee/992561a7e22f0db7322143e9c17fb3bd to your computer and use it in GitHub Desktop.
Truncate docker container log
export CONTAINER_ID=<container_name_or_id>
truncate -s 0 $(docker inspect --format='{{.LogPath}}' ${CONTAINER_ID})
## or
echo "" > $(docker inspect --format='{{.LogPath}}' ${CONTAINER_ID})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment