I'm trying to do the bandwidth throttling to the Docker containers.
To limit the downlink bandwidth, I can first find the veth interface of the container and use tc: tc qdisc add dev vethpair1 root tbf rate 1mbit latency 50ms burst 10000
. If I want to limit the uplink bandwidth, I need to specify --cap-add=NET_ADMIN
when I spin up the container and use the same tc command on eth0
inside the container. Is there any non-intrusive way to do it, so that I can administrate any container without giving it privilege?
相关问题
- Docker task in Azure devops won't accept "$(pw
- Unable to run mariadb when mount volume
- Unspecified error (0x80004005) while running a Doc
- What would prevent code running in a Docker contai
- How to reload apache in php-apache docker containe
You could tell Docker to use LXC under the hoods : use the
-e lxc
option.Check the official documentation about how to apply bandwidth limits to this class.
Note : the
--storage-driver=devicemapper
and-e lxc
options are for the Docker daemon, not for the Docker client you're using when runningdocker run .......
.ALso you can do this through this: