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