Suggestions for container filesystem layout?

When building a container image with nginx, the package contents are placed in the root filesystem, with folders like /conf and /html, which is rather unconventional, and can quickly become messy as more packages are added.

IIUC, the suggestion is to manually move these folders to where is more conventional, but that obviously adds a lot of work.

Using nix profile add, I would the same would happen, but in the nix profile directory. Which would look nicer at first glance, but merely hides the mess.

What alternatives do I have?

For example, instead of using buildEnv, perhaps using cp into /packages/nginx/ ?

Well, we don’t know how you build your image exactly, though indeed, usually we make sure to have data in appropriate locations.

I don’t know why that making more work than using $out/html

1 Like

One of the advantages of using buildEnv, I assume, is that it would fetch the missing packages in parallel?

What about when using cp in a runCommand? Does it search the script for packages, fetch them in parallel, and then template the paths into the runCommand script? I’ve tried looking at the code but it doesn’t make sense to me how the text is interpreted.