build: allow baking multiple pills into docker images

By baking (potentially) multiple pills into an image, we can provide
mainnet vs ropsten images. It is still up to the operator to pass
along the pill path(s) to the entrypoint. For example, using Docker:

docker run --tty urbit -B /share/brass.pill -J /share/ivory.pill ...

The main .image attribute still uses only the solid pill, and image-ropsten
has been provided with brass and ivory pills.

Additionally herb has been added to the image for convenience.
This commit is contained in:
Brendan Hay 2019-12-18 11:01:15 +01:00
parent 38eefb30cb
commit 122e01b13d
No known key found for this signature in database
GPG Key ID: 80E915C54A7C457D
2 changed files with 24 additions and 6 deletions

View File

@ -74,8 +74,13 @@ rec {
};
image = import ./image {
inherit pkgs urbit;
pill = bootsolid;
inherit pkgs herb urbit solid;
};
image-ropsten = import ./image {
inherit pkgs herb urbit;
brass = brass-ropsten;
ivory = ivory-ropsten;
};
}

View File

@ -1,6 +1,17 @@
{ pkgs, urbit, pill }:
{ pkgs
, herb
, urbit
, solid ? null
, brass ? null
, ivory ? null
}:
pkgs.dockerTools.buildImage {
let
link = pill: path:
if pill == null then ""
else "${pkgs.coreutils}/bin/ln -sf ${pill} ${path}";
in pkgs.dockerTools.buildImage {
name = urbit.meta.name;
runAsRoot = ''
@ -12,10 +23,12 @@ pkgs.dockerTools.buildImage {
mkdir -p /share /data /tmp
${pkgs.coreutils}/bin/ln -sf ${pill} /share/urbit.pill
${link solid "/share/solid.pill"}
${link brass "/share/brass.pill"}
${link ivory "/share/ivory.pill"}
'';
contents = [ urbit ];
contents = [ urbit herb ];
config = {
Entrypoint = [ urbit.meta.name ];