I have project bar that is a library with a Rust FFI.
I have project foo that imports bar in the standard way:
perSystem = {
...
}: {
haskellProjects.default = {
imports = [
inputs.bar.haskellFlakeProjectModules.output
];
settings = {
foo = {
self,
super,
...
}: {
justStaticExecutables = true;
removeReferencesTo = [
self.bar
];
};
};
};
};
The Docker image derivation is:
packages.dockerImage = pkgs.dockerTools.buildImage {
name = "foo";
created = "now";
tag = "0.1";
copyToRoot = pkgs.buildEnv {
paths = with pkgs; [
self'.packages.default
];
name = "foo-root";
pathsToLink = ["/bin"];
};
config = {
Cmd = ["${self'.packages.default}/bin/foo"];
};
};
This produces an image that contains only executables and libraries for Haskell. It includes all the source of the Rust packages the bar library needs to build.
Any ideas on how to slim down this image?
I have project
barthat is a library with a Rust FFI.I have project
foothat importsbarin the standard way:The Docker image derivation is:
This produces an image that contains only executables and libraries for Haskell. It includes all the source of the Rust packages the
barlibrary needs to build.Any ideas on how to slim down this image?