Skip to content

Instantly share code, notes, and snippets.

@batmat
Last active August 29, 2015 14:28
Show Gist options
  • Save batmat/33d4bdb18d962b25ade6 to your computer and use it in GitHub Desktop.
Save batmat/33d4bdb18d962b25ade6 to your computer and use it in GitHub Desktop.
Small PoC script showing the disk usage can grow very quickly with forgotten volumes (and it's not removable through docker rm[i])
#!/bin/bash
set -eou pipefail
COUNT=5
SIZE_IN_MB=500
while [[ $COUNT > 0 ]]; do
sudo du -sm /var/lib/docker
docker run -v /pouet debian fallocate -l ${SIZE_IN_MB}M /pouet/test.img
COUNT=$(( $COUNT - 1 ))
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment