Skip to content

docker::run memory_limit sets a seemingly invalid default value #748

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
AndrewLipscomb opened this issue May 12, 2021 · 3 comments
Closed

Comments

@AndrewLipscomb
Copy link
Contributor

Docker's documentation for the -m command states

The maximum amount of memory the container can use. If you set this option, the minimum allowed value is 4m (4 megabyte).

https://docs.docker.com/config/containers/resource_constraints/

However docker::run defaults this (optional) argument to a defined value of 0b

Optional[Pattern[/^[\d]*(b|k|m|g)$/]] $memory_limit = '0b',

Is there a reasoning as to why this value is set to an apparently invalid number vs leaving it as undef? Especially given its already optional

As far as I can tell - Docker is simply ignoring this specified constraint (I have plenty of containers that happily eat several MB of memory) - however that could change and many containers deployed using this module could unexpectedly break.

@Vincevrp
Copy link
Contributor

Vincevrp commented Nov 9, 2021

I'm using podman-docker (#562) and this default value prevents containers from starting. Podman is unable to start the container and reports: Error: OCI runtime error: unable to start container fcd02362087d56b8829dbf4050c8106985733d06c690720ccbfbe3754323eb9e: sync socket closed.

The kernel (obviously) complains about Memory cgroup out of memory

@github-actions
Copy link

This issue has been marked as stale because it has been open for a while and has had no recent activity. If this issue is still important to you please drop a comment below and we will add this to our backlog to complete. Otherwise, it will be closed in 7 days.

@kenyon
Copy link
Contributor

kenyon commented Jun 23, 2023

reopen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants