title: Docker-compose: how to do version 2 "mem_limit" in version 3?
body: <p>Recently, I tried upgrading a version <code>2</code> <code>docker-compose</code> <code>yaml</code> file to version <code>3</code>.  Specifically, I was going from 2.1 to 3.4.  Using <code>docker-compose</code> version 1.18.0 and <code>docker</code> version 18.06.01.</p>
  
  <p>The first attempt caused <code>docker-compose</code> to abort because of the presence of the Version 2 option: <code>mem_limit</code>.  Reading these <a href="https://docs.docker.com/compose/compose-file/compose-versioning" rel="nofollow noreferrer">Version 3 docs</a>, it clearly states <code>mem_limit</code> was removed and to see "upgrading" to guide usage away from this option.   These instruction tell you to use the <code>deploy</code> section with <code>resources</code>.  Making these changes to the <code>docker-compose.yml</code> file and the system started normally.</p>
  
  <p>Unfortunately, I missed the disclaimer in there where it states that <code>deploy</code> is ignored by <code>docker-compose</code>!  My question: is there a way to use Compose file reference 3 and <code>docker-compose</code> while still enforcing a container memory limit?</p>