<p>How to limit a container's network usage or bandwidth?</p>

<p>I searched the Internet but it seems no existing mature solutions.</p>

<p>I can modify the host, but cannot modify the program running in docker or docker itself. It means I can change the configurations, but not the <em>code</em> of docker that I need to re-build/re-compile.</p>

<p><a href="https://github.com/moby/moby/issues/9607" rel="noreferrer">Docker issue 9607</a> refers to <a href="https://docs.docker.com/network/bridge/" rel="noreferrer">bridge network</a>, and <a href="https://github.com/moby/moby/issues/4763" rel="noreferrer">issue 4763</a> is still opened.</p>

<p>So this is not yet natively supported by docker.</p>

<p><a href="https://github.com/kubernetes/kubernetes/issues/2856" rel="noreferrer">Kubernetes issue 2856</a> references a <a href="https://istio.io/docs/tasks/policy-enforcement/rate-limiting.html" rel="noreferrer">sidecar option: istio</a>, so that would be your best approach, if you can add an orchestrator to your current docker setup.</p>
