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: 776f084cf1bc
Choose a base ref
...
head repository: NixOS/nixpkgs
compare: f7e67be1dc19
Choose a head ref
  • 2 commits
  • 3 files changed
  • 2 contributors

Commits on Dec 5, 2018

  1. dockerTools.buildImage: support using a layered image in fromImage

    Docker images used to be, essentially, a linked list of layers. Each
    layer would have a tarball and a json document pointing to its parent,
    and the image pointed to the top layer:
    
        imageA  ----> layerA
                        |
                        v
                      layerB
                        |
                        v
                      layerC
    
    The current image spec changed this format to where the Image defined
    the order and set of layers:
    
        imageA  ---> layerA
                |--> layerB
                `--> layerC
    
    For backwards compatibility, docker produces images which follow both
    specs: layers point to parents, and images also point to the entire
    list:
    
        imageA  ---> layerA
                |      |
                |      v
                |--> layerB
                |      |
                |      v
                `--> layerC
    
    This is nice for tooling which supported the older version and never
    updated to support the newer format.
    
    Our `buildImage` code only supported the old version, so in order for
    `buildImage` to properly generate an image based on another image
    with `fromImage`, the parent image's layers must fully support the old
    mechanism.
    
    This is not a problem in general, but is a problem with
    `buildLayeredImage`.
    
    `buildLayeredImage` creates images with newer image spec, because
    individual store paths don't have a guaranteed parent layer. Including
    a specific parent ID in the layer's json makes the output less likely
    to cache hit when published or pulled.
    
    This means until now, `buildLayeredImage` could not be the input to
    `buildImage`.
    
    The changes in this PR change `buildImage` to only use the layer's
    manifest when locating parent IDs. This does break buildImage on
    extremely old Docker images, though I do wonder how many of these
    exist.
    
    This work has been sponsored by Target.
    grahamc committed Dec 5, 2018
    Copy the full SHA
    c88337c View commit details
    Browse the repository at this point in the history

Commits on Dec 7, 2018

  1. Merge pull request #51528 from grahamc/buildImage-on-layered-image

    dockertools buildImage: support new-style image specs
    nlewo committed Dec 7, 2018
    Copy the full SHA
    f7e67be View commit details
    Browse the repository at this point in the history