4 ms·
> it would be great to use something like guix to define all the libsodium+zeromq+czmq+zyre dependancies and be able to spit out an 'ultimate container image'
by Ruud-v-A 8y ago
> it would be great to use something like guix to define all the libsodium+zeromq+czmq+zyre dependancies and be able to spit out an 'ultimate container image'
You define a package for your own project that depends on libsodium/zeromq/etc from GuixSD. Then you export your own package with 'guix pack'. For an example of what a package definition looks like, take a look in /gnu/packages in the GuixSD repository, for instance libsodium [1] or Vim [2].
I did something similar recently to build an Nginx "application bundle" [3]. It uses Nix (previously Guix, but Nix worked better for me in the end) to build a squashfs image. You can then run the binary on that filesystem with systemd-nspawn, or as a regular service by setting RootImage=. Some advantages over the Docker approach are that you can easily customise the build (e.g. changing the ./configure flags for Nginx without having to manually perform all other build steps), and bit by bit reproducibility (if you build the same commit six months from now, on a different machine, you will still get the same image out).
[1]: https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/crypto.scm?id=cbf58afa05b6014f59b49ec043aff6239fbe7313#n67 https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages...
[2]: https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/vim.scm?id=cbf58afa05b6014f59b49ec043aff6239fbe7313#n61 https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages...
[3]: https://github.com/ruuda/miniserver#readme https://github.com/ruuda/miniserver#readme