Skip to content

Instantly share code, notes, and snippets.

@log2c
Created March 21, 2023 09:02
Show Gist options
  • Save log2c/547b3a95b099d72958898daaba6c31ab to your computer and use it in GitHub Desktop.
Save log2c/547b3a95b099d72958898daaba6c31ab to your computer and use it in GitHub Desktop.
清空docker container logs

清空docker container logs

找出docker container日志文件所在的路径

docker inspect --format='{{.LogPath}}' <container_name_or_id>

删除或者清空日志文件内容

echo |sudo tee $(docker inspect --format='{{.LogPath}}' <container_name_or_id>)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment