Last active
March 26, 2018 23:00
-
-
Save zarmin/48d95c9fa1d64f8923e0b10bfca2b87e to your computer and use it in GitHub Desktop.
Docker XFS Quota
This file contains 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 -e | |
# use as: ./docker_xfs_quota.sh <container id> | |
# requires xfsprogs, jq, docker | |
DIFF_DIR_PATH="$(docker inspect $1 | jq -r '.[0].GraphDriver.Data.UpperDir')" | |
PQUOTA_PROJECT_ID="$(xfs_io -c lsproj $DIFF_DIR_PATH | sed 's/projid = //')" | |
xfs_quota -x -c "quota -h -p ${PQUOTA_PROJECT_ID}" /var/lib/docker/ | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment