Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Is there a clean way to do reuse this for multistage builds?

```

FROM nixery.dev/shell/git/node14/python3.8 as debug_extras

FROM our/production:1.2.3

COPY --from=debug_extras /nixstuff /ubuntu/stuff

RUN python -c "print('nice!')"

```



It depends on what you are trying to get out of the builder pattern. I think it wouldn't provide any benefit to you but hard to say without knowing exactly what you want to achieve.

e.g. if you want to remove all the stuff that you aren't using then nix already does that with a GC


You could copy over the nix store, though your path wouldn’t be set up correctly to find the programs you want.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: