1
0
Fork 0
forked from mirror/grapevine

break oci image builder into a function

Now it can be reused for different `pkgs` and `package`s.
This commit is contained in:
Charles Hall 2024-01-25 19:36:17 -08:00
parent 0e8e4f1083
commit 2a04a361e0
No known key found for this signature in database
GPG key ID: 7B8E0645816E07CF

View file

@ -159,30 +159,29 @@
meta.mainProgram = cargoToml.package.name;
};
in
{
packages = {
default = package pkgsHost;
oci-image =
let
package = self.packages.${system}.default;
in
pkgsHost.dockerTools.buildImage {
mkOciImage = pkgs: package:
pkgs.dockerTools.buildImage {
name = package.pname;
tag = "latest";
config = {
# Use the `tini` init system so that signals (e.g. ctrl+c/SIGINT)
# are handled as expected
Entrypoint = [
"${pkgsHost.lib.getExe' pkgsHost.tini "tini"}"
"${pkgs.lib.getExe' pkgs.tini "tini"}"
"--"
];
Cmd = [
"${pkgsHost.lib.getExe package}"
"${pkgs.lib.getExe package}"
];
};
};
in
{
packages = {
default = package pkgsHost;
oci-image = mkOciImage pkgsHost self.packages.${system}.default;
} // builtins.listToAttrs (
builtins.map
(crossSystem: {