What you mention is a major reason why Linux containers were invented, and is already possible with Docker today.  Take a look at the &#x27;--mem-limit&#x27; or &#x27;--cpu-shares&#x27; flags for &#x27;docker run&#x27;, for instance.