Skip to content

Commit

Permalink
Clarfy the binary reproducibility problems of created=now with docker…
Browse files Browse the repository at this point in the history
…Tools.buildImage.
  • Loading branch information
grahamc committed Sep 21, 2018
1 parent 10450ff commit 7736337
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions doc/functions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -642,20 +642,22 @@ buildImage {
<example xml:id="example-pkgs-dockerTools-buildImage-creation-date">
<title>Impurely Defining a Docker Layer's Creation Date</title>
<para>
Because dates are an impurity, by default
<function>buildImage</function> will use a static date of one
second past the UNIX Epoch. This can be a bit frustrating when
listing docker images in the CLI:
By default <function>buildImage</function> will use a static
date of one second past the UNIX Epoch. This allows
<function>buildImage</function> to produce binary reproducible
images. When listing images with <command>docker list
images</command>, the newly created images will be listed like
this:
</para>
<screen><![CDATA[
$ docker image list
REPOSITORY TAG IMAGE ID CREATED SIZE
hello latest 08c791c7846e 48 years ago 25.2MB
]]></screen>
<para>
If you want to trade the purity for a better user experience,
you can set <literal>created</literal> to
<literal>now</literal>.
You can break binary reproducibility but have a sorted,
meaningful <literal>CREATED</literal> column by setting
<literal>created</literal> to <literal>now</literal>.
</para>
<programlisting><![CDATA[
pkgs.dockerTools.buildImage {
Expand All @@ -670,12 +672,13 @@ pkgs.dockerTools.buildImage {
<para>
and now the Docker CLI will display a reasonable date and
sort the images as expected:
</para>
<screen><![CDATA[
<screen><![CDATA[
$ docker image list
REPOSITORY TAG IMAGE ID CREATED SIZE
hello latest de2bf4786de6 About a minute ago 25.2MB
]]></screen>
however, the produced images will not be binary reproducible.
</para>
</example>
</section>

Expand Down

0 comments on commit 7736337

Please sign in to comment.