Docker.github.io: Mention that "resources" key has to be under "deploy"

Created on 22 Apr 2017  路  3Comments  路  Source: docker/docker.github.io

File: compose/compose-file/index.md, CC @londoncalling

As mentioned in https://github.com/docker/compose/issues/4687 it would be very helpful if the description for "resources" mentioned that it needs to be under a "deploy". I think this means you can't have a single docker-compose.yml for "local" and swarm deploys (and still limit memory)?

Also, maybe mention that memswap_limit doesn't work with compose 1.11.2 or maybe that's wrong name?

services.jenkins.deploy.resources.limits value Additional properties are not allowed ('memswap_limit' was unexpected)
areCompose

Most helpful comment

@londoncalling In the deploy section, the example for the labels key is a complete Compose file that seems to be better at indicating where exactly the section should be found.

version: "3"
services:
  web:
    image: web
    deploy:
      labels:
        com.example.description: "This label will appear on the web service"

OTOH, the example for resources (and most other deploy subsections) is "unrooted".

resources:
  limits:
    cpus: '0.001'
    memory: 50M
  reservations:
    cpus: '0.0001'
    memory: 20M

Maybe a fuller example as with labels would be more helpful to readers?

All 3 comments

@jamshid

  • resources already appears as a subtopic under deploy in the Compose file reference, indicating that it is a subkey of deploy (take the link to deploy I provided here, and look at right navigation menu)

  • We might be able to extend the example immediately under the deploy heading to include more subkeys, like resources. @shin- would that make sense to do?

  • Defer to @shin- and @dnephin for best way to handle this confusion re: resources, as well as for your question on memswap_limit

@londoncalling In the deploy section, the example for the labels key is a complete Compose file that seems to be better at indicating where exactly the section should be found.

version: "3"
services:
  web:
    image: web
    deploy:
      labels:
        com.example.description: "This label will appear on the web service"

OTOH, the example for resources (and most other deploy subsections) is "unrooted".

resources:
  limits:
    cpus: '0.001'
    memory: 50M
  reservations:
    cpus: '0.0001'
    memory: 20M

Maybe a fuller example as with labels would be more helpful to readers?

Fixed in #3035

Was this page helpful?
0 / 5 - 0 ratings