mirror of
https://github.com/juanfont/headscale.git
synced 2024-11-29 18:33:05 +00:00
Add option to build docker image
This commit adds dockerbuild to flakes.nix: ``` nix build .#headscale-docker ``` This uses the Nix infra to build and _does not_ use Dockerfile. It currently works on Linux (no macOS)
This commit is contained in:
parent
124d8a3424
commit
a6570d33a6
1 changed files with 13 additions and 0 deletions
13
flake.nix
13
flake.nix
|
@ -84,6 +84,16 @@
|
||||||
buf
|
buf
|
||||||
clang-tools # clang-format
|
clang-tools # clang-format
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
|
# Add entry to build a docker image with headscale
|
||||||
|
# caveat: only works on Linux
|
||||||
|
headscale-docker = pkgs.dockerTools.buildLayeredImage {
|
||||||
|
name = "headscale";
|
||||||
|
tag = "latest";
|
||||||
|
contents = [ pkgs.${system}.headscale ];
|
||||||
|
config.Entrypoint = [ (pkgs.${system}.headscale + "/bin/headscale") ];
|
||||||
|
};
|
||||||
in
|
in
|
||||||
rec {
|
rec {
|
||||||
# `nix develop`
|
# `nix develop`
|
||||||
|
@ -92,6 +102,8 @@
|
||||||
# `nix build`
|
# `nix build`
|
||||||
packages = with pkgs; {
|
packages = with pkgs; {
|
||||||
inherit headscale;
|
inherit headscale;
|
||||||
|
inherit headscale-docker;
|
||||||
|
|
||||||
};
|
};
|
||||||
defaultPackage = pkgs.headscale;
|
defaultPackage = pkgs.headscale;
|
||||||
|
|
||||||
|
@ -101,5 +113,6 @@
|
||||||
};
|
};
|
||||||
defaultApp = apps.headscale;
|
defaultApp = apps.headscale;
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue