Created
June 6, 2023 06:20
-
-
Save sarangnx/81c4fcd82d01226e14ae4ad798eced11 to your computer and use it in GitHub Desktop.
Delete logs of all docker containers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
container_ids=$(docker ps -q) | |
for container_id in $container_ids; do | |
sudo truncate -s 0 $(docker inspect --format='{{.LogPath}}' "$container_id") | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment