2019-10-14 10:17:40 +03:00
|
|
|
{ pkgs, urbit, pill }:
|
2019-10-03 21:19:07 +03:00
|
|
|
|
2019-10-04 21:29:18 +03:00
|
|
|
let
|
2019-10-14 10:17:40 +03:00
|
|
|
|
|
|
|
entrypoint = pkgs.writeScript "entrypoint.sh" ''
|
2019-10-04 21:29:18 +03:00
|
|
|
#!${pkgs.stdenv.shell}
|
|
|
|
|
|
|
|
set -euo pipefail
|
|
|
|
|
2019-10-21 11:03:41 +03:00
|
|
|
${urbit.meta.exe} "$@"
|
2019-10-04 21:29:18 +03:00
|
|
|
'';
|
2019-10-14 10:17:40 +03:00
|
|
|
|
2019-10-04 21:29:18 +03:00
|
|
|
in
|
|
|
|
|
2019-10-03 21:19:07 +03:00
|
|
|
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
|
|
|
|
|
|
|
|
export PATH=/bin:/usr/bin:/sbin:/usr/sbin:$PATH
|
|
|
|
|
|
|
|
${pkgs.dockerTools.shadowSetup}
|
|
|
|
|
2019-10-21 11:03:41 +03:00
|
|
|
mkdir -p /bin /share /data /tmp
|
|
|
|
|
|
|
|
${pkgs.coreutils}/bin/ln -sf ${pill} /share/urbit.pill
|
|
|
|
${pkgs.coreutils}/bin/ln -sf ${entrypoint} /bin/urbit
|
2019-10-03 21:19:07 +03:00
|
|
|
'';
|
|
|
|
|
|
|
|
config = {
|
2019-10-21 11:03:41 +03:00
|
|
|
Entrypoint = [ "urbit" ];
|
2019-10-03 21:19:07 +03:00
|
|
|
|
|
|
|
WorkingDir = "/data";
|
|
|
|
|
2019-10-21 11:03:41 +03:00
|
|
|
Env = [ "PATH=/bin" ];
|
|
|
|
|
2019-10-03 21:19:07 +03:00
|
|
|
Volumes = {
|
|
|
|
"/data" = {};
|
|
|
|
};
|
|
|
|
|
|
|
|
ExposedPorts = {
|
|
|
|
"80/tcp" = {};
|
|
|
|
"443/tcp" = {};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|