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>
This commit is contained in:
morguldir 2024-04-15 16:55:28 +02:00
parent 6d47c20efa
commit 2c19b5c809
No known key found for this signature in database
GPG key ID: 5A6025D4F6E7A8A3

View file

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