docker-compose


Limit resources in docker-compose v3


mem_limit is no longer supported in version 3 of docker-compose.yml file. The documentation tells that I should use the deploy.resources key instead but also that this part will only be effective with swarm or docker stack.
cpu_shares, cpu_quota, cpuset, mem_limit, memswap_limit: These have been replaced by the resources key under deploy. Note that deploy configuration only takes effect when using docker stack deploy, and is ignored by docker-compose.
... as written in the docs.
How do I set memory/cpu limits with docker-compose with v3 format of the yml file?
I was wondering the same thing and found this:
https://github.com/docker/compose/issues/4513
So in short it's just not possible to do that, you have to use the version 2.1 of the docker-compose format to be able to specify limits that are not ignored by docker-compose up
I was searching the same too...
I think the links are little but you can land here:
https://docs.docker.com/compose/compose-file/#resources
resources:
limits:
cpus: '0.001'
memory: 50M
reservations:
cpus: '0.0001'
memory: 20M
and
https://docs.docker.com/engine/reference/run/#runtime-constraints-on-resources
for more details on constraints

Related Links

Passing arguments to docker compose file when using it for swarm
How to run ad hoc docker compose commands in Ansible?
Using custom hostnames for docker local development containers
Changing the network name?
Let external container know about subnets created by multiple docker-compose projects
How to monitor / discover more docker containers with prometheus
two docker-compose .yml in the same network with COMPOSE_PROJECT_NAME
docker compose 3.1(swarm), secrets, ssl and nginx
What is the version directive for?
How to run docker-compose up -d at system start up?
In Docker Compose can I have services exiting
Docker compose - secrets Additional property secrets is not allowed
docker-compose mounted volume remain
Should I do anything after upgrading docker-compose?
docker caddy proxy not forwarding
docker share OS volume between services

Categories

HOME
indexing
redux
jenkins-pipeline
python-requests
x86-64
multipartform-data
atlassian-fisheye
virtualhost
coding-style
velocity
ng2-charts
cakephp-2.0
eclipse-orion
reportlab
filehelpers
powerpivot
orange
monad-transformers
coccinelle
advertising
rancher
jboss-arquillian
boost-log
foxpro
jmsserializerbundle
wordpress-rest-api
kofax
libconfig
ng-lightning
julia-jump
fisheye
pyexcel
collation
qt-quick
apiman
taiga
niagara-ax
xmldom
hdpi
rmq
vertex-shader
portaudio
android-tabs
glade
jspx
particle-system
recurring
kik
sbt-proguard
3d-rendering
jmap
nd4j
wordpress-plugin
mojolicious
consul-template
android-filterable
clearquest
page-refresh
sicstus-prolog
google-experiments
xmla
indices
xcode5
unityvs
sync
powerpoint-2010
switchpreference
code-smell
surfaceview
infinity.js
auctex
phone-state-listener
vline
nsregularexpression
inflate
winrt-async
jquery-ui-map
animationdrawable
parsec
datejs
method-call
zipstream
lwp
azure-appfabric
konsole
pkcs#7
morfik
focus-stealing

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App