diff --git a/docker.nix b/docker.nix new file mode 100644 index 0000000..fb2aa97 --- /dev/null +++ b/docker.nix @@ -0,0 +1,9 @@ +{ dockerTools, my-crate }: +dockerTools.buildLayeredImage { + name = my-crate.pname; + tag = "latest"; + + contents = [ my-crate ]; + + config.Cmd = [ ("/bin/" + my-crate.pname) ]; +} diff --git a/flake.nix b/flake.nix index 5dd2d1b..4b8563e 100644 --- a/flake.nix +++ b/flake.nix @@ -123,6 +123,8 @@ my-crate-llvm-coverage = craneLibLLvmTools.cargoLlvmCov (commonArgs // { inherit cargoArtifacts; }); + + docker-image = pkgs.callPackage ./docker.nix { inherit my-crate; }; }; apps.default = flake-utils.lib.mkApp {