From d0b33648223427e635df7336097f8732764d3419 Mon Sep 17 00:00:00 2001 From: Tom Bereknyei Date: Wed, 25 Sep 2024 00:25:47 -0400 Subject: [PATCH] dockerTools: set mtime to epoch by default --- doc/build-helpers/images/dockertools.section.md | 4 ++-- pkgs/build-support/docker/default.nix | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/build-helpers/images/dockertools.section.md b/doc/build-helpers/images/dockertools.section.md index c1a9526466cd..26c1d9c14a26 100644 --- a/doc/build-helpers/images/dockertools.section.md +++ b/doc/build-helpers/images/dockertools.section.md @@ -516,7 +516,7 @@ This allows the function to produce reproducible images. `created` (String; _optional_) : Specifies the time of creation of the generated image. - This date will be used for the image metadata, and as the default value for `mtime`. + This date will be used for the image metadata. This should be either a date and time formatted according to [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) or `"now"`, in which case the current date will be used. :::{.caution} @@ -535,7 +535,7 @@ This allows the function to produce reproducible images. Using `"now"` also means that the generated image will not be reproducible anymore (because the date will always change whenever it's built). ::: - _Default value:_ the same value as `created`. + _Default value:_ `"1970-01-01T00:00:01Z"`. `uid` (Number; _optional_) []{#dockerTools-buildLayeredImage-arg-uid} `gid` (Number; _optional_) []{#dockerTools-buildLayeredImage-arg-gid} diff --git a/pkgs/build-support/docker/default.nix b/pkgs/build-support/docker/default.nix index 264cfbf82eed..c19df2937539 100644 --- a/pkgs/build-support/docker/default.nix +++ b/pkgs/build-support/docker/default.nix @@ -907,7 +907,7 @@ rec { , config ? { } , architecture ? defaultArchitecture , created ? "1970-01-01T00:00:01Z" - , mtime ? created + , mtime ? "1970-01-01T00:00:01Z" , uid ? 0 , gid ? 0 , uname ? "root"