-
Notifications
You must be signed in to change notification settings - Fork 1
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
Container fails to run with memory limit #5
Comments
Looks like podman expects cgroups to be set up on the system, and we don’t currently do that yet: containers/podman#14236 (comment) Not entirely sure what the minimum steps are to fix this. Contributions welcome :) |
Thanks for the reference, I will try something and if it works will share the updates here. |
The steps mentioned in the referenced issue works. I used the same code as mentioned in https://gokrazy.org/packages/docker-containers/ and added a function const (
CgroupPath = "/sys/fs/cgroup/podman_containers"
)
func setCgroups() error {
// create a cgroups path
if err := os.MkdirAll(CgroupsPath, 0755); err != nil {
return err
}
// set current process pid in that cgroup.procs
if err := os.WriteFile(filepath.Join(CgroupsPath, "cgroup.procs"), []byte(strconv.Itoa(os.Getpid())), 0644); err != nil {
return err
}
return nil
}
func irssi() error {
// Ensure we have an up-to-date clock, which in turn also means that
// networking is up. This is relevant because podman takes what’s in
// /etc/resolv.conf (nothing at boot) and holds on to it, meaning your
// container will never have working networking if it starts too early.
gokrazy.WaitForClock()
if err := mountVar(); err != nil {
return err
}
if err := setCgroups(); err != nil {
return err
}
// ...
} |
It sounds to me like commits containers/podman@94e8212 and/or containers/podman@bd51410 will fix this without requiring changes from our end, but are not yet in a tagged podman release. |
gokrazy/podman is now updated to v4.2.1, which contains the fixes. For me, |
When adding
-m
or--memory
as limit topodman run
command it fails with following error.I tried to check the mount and that was available.
I also tried adding options like
nsdelegate
andmemory_recursiveprot
, but it had the same issue.The text was updated successfully, but these errors were encountered: