mirror of
https://github.com/urbit/shrub.git
synced 2024-12-21 09:51:36 +03:00
122e01b13d
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.
48 lines
746 B
Nix
48 lines
746 B
Nix
{ pkgs
|
|
, herb
|
|
, urbit
|
|
, solid ? null
|
|
, brass ? null
|
|
, ivory ? null
|
|
}:
|
|
|
|
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 = ''
|
|
#!${pkgs.stdenv.shell}
|
|
|
|
set -euo pipefail
|
|
|
|
${pkgs.dockerTools.shadowSetup}
|
|
|
|
mkdir -p /share /data /tmp
|
|
|
|
${link solid "/share/solid.pill"}
|
|
${link brass "/share/brass.pill"}
|
|
${link ivory "/share/ivory.pill"}
|
|
'';
|
|
|
|
contents = [ urbit herb ];
|
|
|
|
config = {
|
|
Entrypoint = [ urbit.meta.name ];
|
|
|
|
WorkingDir = "/data";
|
|
|
|
Volumes = {
|
|
"/data" = {};
|
|
};
|
|
|
|
ExposedPorts = {
|
|
"80/tcp" = {};
|
|
"443/tcp" = {};
|
|
};
|
|
};
|
|
}
|