Skip to content

Commit

Permalink
Add option to build docker image
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
kradalby committed Mar 7, 2022
1 parent 124d8a3 commit a6570d3
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,16 @@
buf
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
rec {
# `nix develop`
Expand All @@ -92,6 +102,8 @@
# `nix build`
packages = with pkgs; {
inherit headscale;
inherit headscale-docker;

};
defaultPackage = pkgs.headscale;

Expand All @@ -101,5 +113,6 @@
};
defaultApp = apps.headscale;


});
}

0 comments on commit a6570d3

Please sign in to comment.