docker/docker-py

memory_limit and memswap_limit support in host_config

nusnewob opened this issue · 4 comments

Unable to set memory_limit and memswap_limit in host_config, both are missing from supported parameters in utils.py.

Containers created using python client,

[{
        "Config":  {
        ...
        "Memory": 2147483648,
        "MemorySwap": -1,
       ...
       "HostConfig": {
        ...
        "Memory": 0,
        "MemorySwap": 0,
        ...

Containers created using commandline with --memory=2048MB --memory_swap=-1

[{
        "Config":  {
        ...
        "Memory": 2147483648,
        "MemorySwap": -1,
       ...
       "HostConfig": {
        ...
        "Memory": 2147483648,
        "MemorySwap": -1,
        ...

As results, limits are only configured in Config and not Host_Config and therefore make no effect.

@shin- I think this is fallout from moby/moby#10298. docker-py currently accepts mem_limit as a direct argument to create_container, but it looks like it should be moved and/or forwarded to create_host_config?

(I'm seeing this issue as well by the way)

It's a 1.7 change. I'll take care of it today.
On Jun 2, 2015 9:37 AM, "Scott Sanderson" notifications@github.com wrote:

(I'm seeing this issue as well by the way)


Reply to this email directly or view it on GitHub
#623 (comment).