Skip to content

Instantly share code, notes, and snippets.

@mshafiee
Last active May 7, 2022 05:23
Show Gist options
  • Save mshafiee/5d7e82aa82541d25cdba0bb4f10af2c4 to your computer and use it in GitHub Desktop.
Save mshafiee/5d7e82aa82541d25cdba0bb4f10af2c4 to your computer and use it in GitHub Desktop.
Limit docker resources usage
# vi /etc/systemd/system/docker_limit.slice
[Unit]
Description=Slice that limits docker resources
Before=slices.target
[Slice]
CPUAccounting=true
CPUQuota=700%
# Memory Management
MemoryAccounting=true
MemoryLimit=7G
# vi /etc/docker/daemon.json
{
"cgroup-parent": "/docker_limit.slice"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment