I am trying to build an image and getting this error message:
rsync: [sender] readdir("/nix/store/ZZZZZ.../some/file"): Cannot allocate memory (12)
Are there any workarounds?
How much RAM do you have and how much is it filled right before the error?
32G total. I am on a shared server with cgroups so I can reserve the memory for my shell session, but I guess the actual build process is running in its own cgroup since it is orchestrated by nix-daemon. Is there anything that can be done to give the build process more memory? Or is it possible to have buildImage use disk instead of collecting the layers in memory?
As a workaround, you could use
nix2container.buildImage which don’t store layers at all
I am finally starting to experiment with
dockerTools.streamLayeredImage! So far my two main questions are:
If packages sitting in different layers have one big dependency, would the final image have just one copy of that dependency or will it be stored as many times as I have layers depending on it? In my case it is MKL library and I have a layer with R closure and another one with Python. Both are built with MKL support.
runAsRoot clause to run
dockerTools.shadowSetup to create a user, then a bunch of
chmod commands. Since
runAsRoot is not supported by
fakeRootCommands be used as a replacement? Will it be able to run all those commands?