nixpkgs/pkgs
Graham Christensen c88337c9ac
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.
2018-12-05 14:25:54 -05:00
..
applications Merge pull request #51499 from kylewlacy/plex-media-player_2-23-0 2018-12-04 15:13:53 +02:00
build-support dockerTools.buildImage: support using a layered image in fromImage 2018-12-05 14:25:54 -05:00
common-updater
data Merge pull request #51494 from romildo/upd.nordic-polar 2018-12-04 15:07:56 +01:00
desktops Merge pull request #51329 from c0bw3b/cleanup/gnu-https 2018-12-02 16:52:33 +01:00
development Merge pull request #51385 from symphorien/pyflame 2018-12-04 14:11:09 +00:00
games Merge pull request #51272 from binarin/anki-python3.7-fix 2018-12-04 16:26:25 +02:00
misc materia-theme: move to pkgs/data/themes 2018-12-04 10:56:57 -02:00
os-specific linux_latest-libre: document finding latest rev 2018-12-04 12:08:30 +00:00
servers rspamd: 1.8.1 -> 1.8.2 2018-12-03 00:13:35 +02:00
shells nix-bash-completions: 0.6.6 -> 0.6.7 2018-12-04 08:34:23 +01:00
stdenv
test
tools Merge pull request #51417 from jvassev/vault 2018-12-04 10:58:34 +00:00
top-level Merge pull request #51385 from symphorien/pyflame 2018-12-04 14:11:09 +00:00