Set the time of the HEAD commit as the OCI created field

Apparently it uses `date -Iseconds` to parse, so we can use @ with a timestamp

Also it doesn't parse `created` in buildImage, only buildLayeredImage

Signed-off-by: morguldir <morguldir@protonmail.com>
Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
morguldir 2024-04-16 22:06:52 -04:00 committed by June
parent 5015fc7a2c
commit b303a774d8

View file

@ -194,10 +194,12 @@
}; };
mkOciImage = pkgs: package: allocator: tag: mkOciImage = pkgs: package: allocator: tag:
pkgs.dockerTools.buildImage { pkgs.dockerTools.buildLayeredImage {
name = package.pname; name = package.pname;
tag = "${tag}"; tag = "${tag}";
copyToRoot = [ # Debian makes builds reproducible through using the HEAD commit's date
created = "@${toString self.lastModified}";
contents = [
pkgs.dockerTools.caCertificates pkgs.dockerTools.caCertificates
]; ];
config = { config = {