Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
base: b0987f201337
Choose a base ref
...
head repository: NixOS/nixpkgs
compare: a32d7e0c7446
Choose a head ref
  • 1 commit
  • 2 files changed
  • 1 contributor

Commits on Sep 20, 2018

  1. dockerTools.buildImage: support impure dates

    Because dates are an impurity, by default buildImage 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:
    
        $ docker image list
        REPOSITORY   TAG      IMAGE ID       CREATED        SIZE
        hello        latest   08c791c7846e   48 years ago   25.2MB
    
    If you want to trade the purity for a better user experience, you can
    set created to now.
    
        pkgs.dockerTools.buildImage {
          name = "hello";
          tag = "latest";
          created = "now";
          contents = pkgs.hello;
    
          config.Cmd = [ "/bin/hello" ];
        }
    
    and now the Docker CLI will display a reasonable date and sort the
    images as expected:
    
        $ docker image list
        REPOSITORY   TAG      IMAGE ID       CREATED              SIZE
        hello        latest   de2bf4786de6   About a minute ago   25.2MB
    graham-at-target authored and globin committed Sep 20, 2018
    Copy the full SHA
    a32d7e0 View commit details
    Browse the repository at this point in the history