2019-12-18 13:01:15 +03:00
|
|
|
{ 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 {
|
2019-10-21 11:03:41 +03:00
|
|
|
name = urbit.meta.name;
|
2019-10-03 21:19:07 +03:00
|
|
|
|
|
|
|
runAsRoot = ''
|
|
|
|
#!${pkgs.stdenv.shell}
|
|
|
|
|
|
|
|
set -euo pipefail
|
|
|
|
|
|
|
|
${pkgs.dockerTools.shadowSetup}
|
|
|
|
|
2019-12-16 11:18:08 +03:00
|
|
|
mkdir -p /share /data /tmp
|
2019-10-21 11:03:41 +03:00
|
|
|
|
2019-12-18 13:01:15 +03:00
|
|
|
${link solid "/share/solid.pill"}
|
|
|
|
${link brass "/share/brass.pill"}
|
|
|
|
${link ivory "/share/ivory.pill"}
|
2019-10-03 21:19:07 +03:00
|
|
|
'';
|
|
|
|
|
2019-12-18 13:01:15 +03:00
|
|
|
contents = [ urbit herb ];
|
2019-12-16 11:18:08 +03:00
|
|
|
|
2019-10-03 21:19:07 +03:00
|
|
|
config = {
|
2019-12-16 11:18:08 +03:00
|
|
|
Entrypoint = [ urbit.meta.name ];
|
2019-10-03 21:19:07 +03:00
|
|
|
|
|
|
|
WorkingDir = "/data";
|
|
|
|
|
|
|
|
Volumes = {
|
|
|
|
"/data" = {};
|
|
|
|
};
|
|
|
|
|
|
|
|
ExposedPorts = {
|
|
|
|
"80/tcp" = {};
|
|
|
|
"443/tcp" = {};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|