When I do docker inspectI read that

Ubuntu 16.04.4 LTS
Docker version 17.05.0-ce, build 89658be
# GRUB_CMDLINE_LINUX="cgroup_enable=memory swapaccount=1"
"MemorySwappiness": -1,


Ubuntu 17.10
Docker version 17.09.0-ce, build afdb6d4
"MemorySwappiness": null,

However the Documentation states that it is a value between 0 and 100. The second example might result from Swapping being disabled on the docker host.

  • Am I missing some paragraph of documentation?
  • Are these undocumented values cast to 0? Or 100?
  • Probably because your kernel doesn't support memory swap and memory limit ("By default, if you do not set --memory-swappiness, the value is inherited from the host machine.") - docs.docker.com/config/containers/resource_constraints/…
    – ponsfrilus
    Apr 26, 2018 at 11:15
  • Probably. But how can I inherit a value of -1 if valid values range from 0 to 100 The value appears to be undocumented or I appear to fail at reading :-)
    – Björn
    Apr 27, 2018 at 8:30
  • Apparently -1 is the default value, docker engine somehow also treats null as -1. Docker is made by human, you can open a git issue to ask them to better document this part.
    – storm
    Apr 30, 2018 at 9:23
  • Sorry forgot the link
    – storm
    Apr 30, 2018 at 9:25

1 Answer 1


-1 is a deprecated value. As you can see in this issue 0 is the new -1


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .