From 77f0d62a2cc87e2a927e2389531b4aa16000139a Mon Sep 17 00:00:00 2001 From: Griffin Smith Date: Sun, 7 Nov 2021 15:46:43 -0500 Subject: feat(xanthous/server): Add derivation for docker image This appears to work pretty nicely! Change-Id: Icf52f58225ee2837b30ba6187ae3ba3c539de9df Reviewed-on: https://cl.tvl.fyi/c/depot/+/3810 Reviewed-by: grfn Tested-by: BuildkiteCI --- users/grfn/xanthous/server/default.nix | 6 +++++- users/grfn/xanthous/server/docker.nix | 21 +++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 users/grfn/xanthous/server/docker.nix diff --git a/users/grfn/xanthous/server/default.nix b/users/grfn/xanthous/server/default.nix index cfb10f642c38..0b3900e4d5fe 100644 --- a/users/grfn/xanthous/server/default.nix +++ b/users/grfn/xanthous/server/default.nix @@ -1,4 +1,5 @@ -{ depot ? import ../../../.. {} +args@{ + depot ? import ../../../.. {} , pkgs ? depot.third_party.nixpkgs , ... }: @@ -7,4 +8,7 @@ depot.third_party.naersk.buildPackage { name = "xanthous-server"; version = "0.0.1"; src = depot.third_party.gitignoreSource ./.; + passthru = { + docker = import ./docker.nix args; + }; } diff --git a/users/grfn/xanthous/server/docker.nix b/users/grfn/xanthous/server/docker.nix new file mode 100644 index 000000000000..e6054a66d28a --- /dev/null +++ b/users/grfn/xanthous/server/docker.nix @@ -0,0 +1,21 @@ +{ depot ? import ../../../.. {} +, pkgs ? depot.third_party.nixpkgs +, ... +}: + +let + inherit (depot.users.grfn) xanthous; + xanthous-server = xanthous.server; + +in pkgs.dockerTools.buildLayeredImage { + name = "xanthous-server"; + tag = "latest"; + contents = [ xanthous xanthous-server ]; + config = { + Cmd = [ + "${xanthous-server}/bin/xanthous-server" + "--xanthous-binary-path" "${xanthous}/bin/xanthous" + ]; + }; + ci = false; +} -- cgit 1.4.1