Last active
May 7, 2022 05:23
-
-
Save mshafiee/5d7e82aa82541d25cdba0bb4f10af2c4 to your computer and use it in GitHub Desktop.
Limit docker resources usage
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
# 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