From ea94c5e417f3468f19e2c3493ba44dd9f5e239f0 Mon Sep 17 00:00:00 2001 From: George Shammas Date: Mon, 16 Nov 2020 21:42:21 -0500 Subject: [PATCH] Add building a docker file --- flake.nix | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/flake.nix b/flake.nix index e142833..8adfe52 100644 --- a/flake.nix +++ b/flake.nix @@ -46,9 +46,25 @@ ''; }); + + ifconfigio-docker = with final; + with pkgs; + (dockerTools.buildLayeredImage { + name = "ifconfig.io"; + tag = version; + created = "now"; + contents = [ ifconfigio busybox ]; + config = { + Cmd = "/bin/ifconfig.io"; + WorkingDir = "/usr/lib/ifconfig.io"; + ExposedPorts = { "8080" = { }; }; + Env = [ "HOSTNAME=ifconfig.io" "TLS=0" "TLSCERT=" "TLSKEY=" ]; + }; + }); }; - packages = - forAllSystems (system: { inherit (nixpkgsFor.${system}) ifconfigio; }); + packages = forAllSystems (system: { + inherit (nixpkgsFor.${system}) ifconfigio ifconfigio-docker; + }); defaultPackage = forAllSystems (system: self.packages.${system}.ifconfigio);