Skip to content

Instantly share code, notes, and snippets.

@zarmin
Last active March 26, 2018 23:00
Show Gist options
  • Save zarmin/48d95c9fa1d64f8923e0b10bfca2b87e to your computer and use it in GitHub Desktop.
Save zarmin/48d95c9fa1d64f8923e0b10bfca2b87e to your computer and use it in GitHub Desktop.
Docker XFS Quota
#!/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