Skip to content

Allow docker_container memory to have String value (eg. memory='1G').#279

Merged
bflad merged 1 commit into
sous-chefs:masterfrom
PerfectMemory:container_memory_with_unit
Mar 18, 2015
Merged

Allow docker_container memory to have String value (eg. memory='1G').#279
bflad merged 1 commit into
sous-chefs:masterfrom
PerfectMemory:container_memory_with_unit

Conversation

@jperville

Copy link
Copy Markdown
Contributor

This very modest PR allows String values for docker_container memory attribute.

Currently, the docker_container resource only allows Fixnum values for the attribute (in other words, memory value is implicitly in bytes) but the docker documentation says that the docker run --memory parameter supports optional units. It is also possible to specify different memory and memory+swap limits.

With this PR I can set docker.memory = '1G' or docker.memory = '150m,200m', while still allowing for Fixnum memory values as before.

@bflad

bflad commented Mar 18, 2015

Copy link
Copy Markdown
Contributor

Awesome! I'm sure a lot of people will appreciate this. Hopefully not too many folks using swap functionality. 😉

bflad added a commit that referenced this pull request Mar 18, 2015
Allow docker_container memory to have String value (eg. memory='1G').
@bflad bflad merged commit e2fac3d into sous-chefs:master Mar 18, 2015
@jperville jperville deleted the container_memory_with_unit branch April 27, 2015 11:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants