nixpkgs-suyu/pkgs/build-support
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
..
agda
bintools-wrapper bintools: use i386 on all 32 bit x86 systems 2018-11-21 09:38:28 -06:00
build-bazel-package bazel-watcher: init at 0.5.0 2018-09-29 13:33:00 -07:00
build-dotnet-package
build-fhs-userenv fix FHSUserEnv blacklists 2018-11-11 10:32:09 -05:00
build-setupcfg Revert "buildSetupcfg: Include unzip for zip sources." 2018-04-14 20:12:22 -04:00
buildenv
cc-wrapper gcc: support avr 2018-10-29 14:34:09 -05:00
docker dockerTools.buildImage: support using a layered image in fromImage 2018-12-05 14:25:54 -05:00
dotnetbuildhelpers
dotnetenv [bot]: remove unreferenced code 2018-07-20 18:48:37 +00:00
emacs melpaBuild: Get package-build from melpa/package-build 2018-11-27 09:36:28 -06:00
expand-response-params
fetchbower
fetchbzr
fetchcvs bsd: init netbsd & openbsd userland 2018-04-24 14:16:35 -05:00
fetchdarcs pkgs/*: remove unreferenced function arguments 2018-07-21 02:48:04 +00:00
fetchdocker Merge branch 'no-toPath' 2018-09-06 08:09:53 -04:00
fetchegg fetchegg: add version to derivation 2018-11-06 00:17:03 +01:00
fetchfossil
fetchgit pkgs/*: remove unreferenced function arguments 2018-07-21 02:48:04 +00:00
fetchgitlocal pkgs/*: remove unreferenced function arguments 2018-07-21 02:48:04 +00:00
fetchgx
fetchhg pkgs/*: remove unreferenced function arguments 2018-07-21 02:48:04 +00:00
fetchipfs
fetchmavenartifact
fetchmtn
fetchnuget pkgs/*: remove unreferenced function arguments 2018-07-21 02:48:04 +00:00
fetchpatch fetchpatch: patchutils -> buildPackages.patchutils 2018-08-21 17:21:25 -04:00
fetchrepoproject
fetchs3 pkgs/*: remove unreferenced function arguments 2018-07-21 02:48:04 +00:00
fetchsvn
fetchsvnrevision
fetchsvnssh
fetchurl fetchurl: mirrors: http -> https, https before http, http before ftp 2018-11-22 09:38:22 +00:00
fetchzip fetchzip: Use unzip from buildPackages 2018-09-21 12:55:32 -04:00
icon-conv-tools
kernel treewide: Remove usage of remaining redundant platform compatability stuff 2018-08-30 17:20:32 -04:00
libredirect libredirect: set install_name on Darwin 2018-11-14 00:05:26 +01:00
make-desktopitem
make-startupitem
make-symlinks
mkshell
mono-dll-fixer
nix-prefetch-github nix-prefetch-github: init -> 1.3 2018-05-22 20:55:07 +02:00
nuke-references
ocaml ocamlPackages.buildDunePackage: fix meta.platforms 2018-11-30 16:19:03 +00:00
references-by-popularity referencesByPopularity: init to sort packages by a cachability heuristic 2018-09-26 15:50:10 -04:00
release reewide: Purge all uses stdenv.system and top-level system 2018-08-30 17:20:32 -04:00
remove-references-to
rust Merge pull request #50452 from P-E-Meunier/carnix-fix 2018-12-03 10:53:25 -05:00
setup-hooks Merge master into staging-next 2018-11-29 08:12:56 +01:00
singularity-tools pkgs/*: remove unreferenced function arguments 2018-07-21 02:48:04 +00:00
skaware skaware: switch from git repos to tarballs 2018-09-06 11:53:22 +02:00
src-only
substitute
substitute-files
templaterpm Compare to None using identity is operator 2018-10-30 21:30:56 +01:00
upstream-updater
vm debian vm tools: use snapshot.debian.org 2018-10-08 18:05:09 +02:00
wrapper-common {bintools,cc}-wrapper: Factor out role accumulation logic 2018-05-07 15:10:45 -04:00
writers build-support writers: add tests 2018-11-27 07:08:13 +01:00
build-maven.nix buildMaven: Support metadata-only dependencies 2018-11-29 17:29:59 +00:00
build-pecl.nix
closure-info.nix make-closure needs build system mkdir and jq 2018-06-29 23:22:24 +00:00
dhall-to-nix.nix
plugins.nix
replace-dependency.nix
setup-systemd-units.nix
source-from-head-fun.nix
trivial-builders.nix trivial builders: adding usage documentation for functions 2018-10-02 22:09:09 +02:00