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

docker-compose restart container if service is dead
Swarm scheduling not working as expected using filters in compose file
issues in buiding Slate with Docker
Invalid type error in Docker Compose
Django cookiecutter with Docker add pip package
Docker Compose + Swarm + Machine Networking issue
docker-compose build image parameters --force-rm --pull
linking 2 containers through docker compose
Files created by manage.py commands not chown'd from root user
Is it possible to create an intermediate image within docker-compose?
docker-compose service listen on specified interface
Does Docker-Compose allow overwriting of ports when using extends?
Jhipster Docker-compose conflict
Build multiple images with Docker Compose?
JHipster Cassandra Docker Build
Defining project name inside docker-compose configuration

Categories

HOME
airflow
oop
optimization
windows-server-2008
ubuntu-14.04
foreach
collision-detection
wavefront
ionic-native
opendaylight
github-flavored-markdown
aggregate
dompdf
samba
google-calendar-api3
hapijs
civicrm
django-rest-auth
ejb-3.1
javaagents
tcpdf
pushbullet
sha
symlink
javapns
delphi-2010
akamai
webspeech-api
webmock
dropdownbox
intersection
border-layout
campaign-monitor
qt-quick
jks
skype-bots
selection-sort
spring-cloud-aws
nls
sqlproj
glade
pebble-js
chomsky-normal-form
stdlist
skbio
methodology
android-facebook
mojolicious
gulp-cdnizer
transbase
persian
traminer
textblob
azure-mobile-app
avrcp
tooltwist
android-networking
nfa
aiff
frisby.js
illegalargumentexception
windows-search
drawable
visual-c#-express-2010
twitter-finagle
slimscroll
carrier
node-amqp
xcode5.1
8-puzzle
grape-api
aspnet-compiler
objectdatasource
mosix
http-compression
mmo
antixsslibrary
linqdatasource
cron4j
derived-class
certificate-revocation
jqueryi-ui-buttonset
mediastreamsource
zend-acl
content-delivery-network

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