Skip to content

Instantly share code, notes, and snippets.

@Justintime50
Last active August 8, 2024 06:14
Show Gist options
  • Save Justintime50/86061d7fc42d74f570926294d03bdf3f to your computer and use it in GitHub Desktop.
Save Justintime50/86061d7fc42d74f570926294d03bdf3f to your computer and use it in GitHub Desktop.
Learn how to clean Docker container logs on macOS

Clean Docker Container Logs on macOS

I searched high and low for a command that worked in 2024 to clean all the Docker container logs on macOS and finally found one that worked:

docker run -it --rm --privileged --pid=host justincormack/nsenter1
truncate -s 0 /var/lib/docker/containers/*/*-json.log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment