summary refs log tree commit diff
path: root/pkgs/build-support/docker
Commit message (Collapse)AuthorAge
* dockerTools.buildLayeredImage: fix typo in commentsAntoine Eiche2020-01-11
|
* dockerTools.buildLayeredImage: fix building layered images in parallelRichard Wallace2019-12-30
| | | | | | | | | | when tar'ing store paths into layered archives when building layered images, don't use the absolute nix store path so that tar won't complain if something new is added to the nix store when building the final docker image, ignore any file changes tar detects in the layers. they are all immutable and the only thing that might change is the number of hard links due to store optimization
* Merge pull request #75781 from ↵Graham Christensen2019-12-17
|\ | | | | | | | | grahamc/dockertools/remove-implementation-detail-layers dockertools.buildLayeredImage: remove implementation detail layers
| * dockerTools.buildLayeredImage: Exclude top level implementation detail layersGraham Christensen2019-12-16
| |
| * dockerTools.buildLayeredImage: prepare to exclude some pathsGraham Christensen2019-12-16
| | | | | | | | | | Without changing behavior, since this code is fiddly, make it possible to add a filtering step before packaging individual paths.
| * dockerTools.buildLayeredImage: pass a list of closures to mkManyPureLayers ↵Graham Christensen2019-12-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | so it can exclude the top-most level Before, every docker image had three extra layers: 1. A `closure` layer which is an internal implementation detail of calculating the closure of the container 2. a `name-config.json` layer which is the images' run-time configuration, and has no business being *in* the image as a layer. 3. a "bulk-layers" layer which is again and implementation detail around collecting the image's closure. None of these layers need to be in the final product.
| * dockerTools.buildLayeredImage: tweak formatting on contentsEnvGraham Christensen2019-12-16
| |
* | Merge pull request #75779 from grahamc/dockertools/fixup-max-layersGraham Christensen2019-12-16
|\ \ | | | | | | dockerTools.buildLayeredImage: update maxlayers from 24 to 100 to match documentation
| * | dockerTools.buildLayeredImage: update maxlayers from 24 to 100 to match ↵Graham Christensen2019-12-16
| |/ | | | | | | | | | | documentation mkManyPureLayers already was changed, and this function was not updated.
* / docker examples: Drop unneeded contents listGraham Christensen2019-12-16
|/
* buildImageWithNixDb: export USER (#74959)tomberek2019-12-07
| | | | | | dockerTools.buildImageWithNixDb: export USER Changes to Nix user detection (./src/nix-channel/nix-channel.cc#L-166) cause this function to error. Exporting USER fixes this.
* dockerTools.examples.nix: set USER in the container configAntoine Eiche2019-12-05
| | | | | A USER is required by Nix. See https://github.com/NixOS/nix/blob/9348f9291e5d9e4ba3c4347ea1b235640f54fd79/src/libutil/util.cc#L478.
* build-support/docker: set default image arch to host archNick Spinale2019-09-16
| | | | | | The architecture of an image should default to the architecture for which that image is being composed or pulled. buildPackages.go.GOARCH is an easy way to compute that architecture with the correct terminology.
* dockertools.buildLayeredImage: default layer count up to 100Graham Christensen2019-08-12
|
* Merge pull request #63865 from dingxiangfei2009/dockertools-cross-compilationSarah Brofeldt2019-07-31
|\ | | | | dockerTools: use skopeo on the right platform
| * dockerTools: use skopeo on the right platformDing Xiang Fei2019-07-02
| |
* | treewide: use dontUnpackworldofpeace2019-07-01
|/
* treewide: remove unused variables (#63177)volth2019-06-16
| | | | | | * treewide: remove unused variables * making ofborg happy
* Merge pull request #54921 from grabango/masterMatthew Bauer2019-06-10
|\ | | | | Use nativeBuildInputs for building Docker images
| * Use nativeBuildInputs for building Docker imagesKevin Rauwolf2019-01-29
| |
* | nixos/tests/docker-tools: check layer sharing with buildLayeredImageDaniël de Kok2019-06-06
| | | | | | | | | | | | Adapted from grahamc's blog post on layered Docker images in Nix: https://grahamc.com/blog/nix-and-layered-docker-images
* | dockerTools.buildLayeredImage: restore layer sharingDaniël de Kok2019-06-06
| | | | | | | | | | | | | | | | PR #58431 added /nix/store to each layer.tar. However, the timestamp was not explicitly set while adding /nix and /nix/store to the archive. This resulted in different SHA256 hashes of layer.tar between image builds. This change sets time and owner when tar'ing /nix/store.
* | dockerTools: Fix the layer orderAntoine Eiche2019-05-07
| | | | | | | | | | | | | | | | | | | | The layer order was not correct when a parent image was used: parent image layers were above the new created layer. This commits simplifies the code related to layer ordering. In particular, layers in `layer-list` are ordered from bottom-most to top-most. This is also the order of layers in the `rootfs.diff_ids` attribute of the image configuration.
* | nixos/tests/docker-tools: verify order of layers in stacked imagesAntoine Eiche2019-05-07
| |
* | treewide: fixup bcf54cernhmjoj2019-04-12
| | | | | | | | | | fix the executable bit for scripts installed with substituteAll and some remaining shebangs.
* | Merge pull request #58350 from ↵lewo2019-04-06
|\ \ | | | | | | | | | | | | xtruder/pkgs/dockerTools/storePathToLayer/runtimeShell dockerTools: storePathToLayer use runtimeShell in script
| * | dockerTools: storePathToLayer use runtimeShell in scriptJaka Hudoklin2019-03-26
| | |
* | | Merge pull request #58360 from xtruder/pkgs/dockerTools/nix-prefetch-dockerJaka Hudoklin2019-04-06
|\ \ \ | | | | | | | | dockerTools: add nix-prefetch-docker script
| * | | dockerTools: add nix-prefetch-docker scriptJaka Hudoklin2019-04-06
| |/ /
* | | Merge pull request #58345 from xtruder/pkgs/dockerTools/pullImage/finalImageNamelewo2019-03-28
|\ \ \ | | | | | | | | dockerTools: add finalImageName parameter for pullImage
| * | | dockerTools: add finalImageName parameter for pullImageJaka Hudoklin2019-03-26
| | | |
* | | | Strip leading ./ in customization layerAlex Biehl2019-03-27
| | | |
* | | | Add /nix/store to each layer.tarAlex Biehl2019-03-27
|/ / / | | | | | | | | | | | | To be totally consistent with the way Docker builds images we need to include the /nix/store in the layer tarballs first.
* / / dockerTools.buildImage.runAsRoot: preserve layers ordering at image unpackingAntoine Eiche2019-03-12
|/ / | | | | | | | | | | | | This patch preserves the ordering of layers of a parent image when the image is unpacked. Fixes #55290
* | nixos/test/docker-tools: fix Nix image digestAntoine Eiche2019-03-06
| |
* | build-support/docker: fix the build of tarsum with Go 1.12Wael M. Nasreddine2019-03-05
| |
* | treewide: use runtimeShell instead of stdenv.shell whenever possibleJörg Thalheim2019-02-26
| | | | | | | | | | | | | | | | | | Whenever we create scripts that are installed to $out, we must use runtimeShell in order to get the shell that can be executed on the machine we create the package for. This is relevant for cross-compiling. The only use case for stdenv.shell are scripts that are executed as part of the build system. Usages in checkPhase are borderline however to decrease the likelyhood of people copying the wrong examples, I decided to use runtimeShell as well.
* | dockerTools: mark store-path-to-layer.sh as executableAustin Seipp2019-02-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | bcf54ce5bbc8c325cfd2b6bcc5cec7661ef49183 introduced a treewide change to use ${stdenv.shell} where-ever possible. However, this broke a script used by dockerTools, store-path-to-layer.sh, as it did not preserve the +x mode bit. This meant the file got put into the store as mode 0444, resulting in a build-time error later on that looked like: xargs: /nix/store/jixivxhh3c8sncp9xlkc4ls3y5f2mmxh-store-path-to-layer.sh: Permission denied However, in a twist of fate, bcf54ce5bbc8c325cfd2b6bcc5cec7661ef49183 not only introduced this regression but, in this particular instance, didn't even fix the original bug: the store-path-to-layer.sh script *still* uses /bin/sh as its shebang line, rather than an absolute path to stdenv. (Fixing this can be done in a separate commit.) Signed-off-by: Austin Seipp <aseipp@pobox.com>
* | Merge branch 'master' into staging-nextVladimír Čunát2019-02-19
|\ \ | | | | | | | | | Hydra nixpkgs: ?compare=1505754
| * | dockerTools.buildImage: preserve layers ordering at image repackingAntoine Eiche2019-02-16
| |/ | | | | | | | | | | | | | | | | This patch preserves the ordering of layers of a parent image when the new image is packed. It is currently not the case: layers are stacked in the reverse order. Fixes #55290
* | Merge branch 'master' into stagingVladimír Čunát2019-01-22
|\|
| * Merge pull request #54270 from ↵lewo2019-01-20
| |\ | | | | | | | | | | | | xtruder/build-support/docker/layered_image_tag_passthru dockerTools: buildLayeredImage passthru imageTag
| | * dockerTools: buildLayeredImage passthru imageTagJaka Hudoklin2019-01-18
| | |
* | | treewide: use ${stdenv.shell} instead of /bin/sh where possiblernhmjoj2019-01-16
|/ /
* | Merge pull request #52870 from ↵lewo2019-01-10
|\ \ | |/ |/| | | | | xtruder/pkgs/dockerTools/buildLayeredImage/extraCommands dockerTools: allow to pass extraCommands, uid and gid to buildLayered image
| * dockerTools: allow to pass extraCommands, uid and gid to buildLayeredImageJaka Hudoklin2019-01-10
| |
* | Merge pull request #52959 from nlewo/runAsRootParentImagelewo2018-12-29
|\ \ | | | | | | dockerTools.example.runAsRootParentImage: init
| * | dockerTools.examples.runAsRootParentImage: initAntoine Eiche2018-12-27
| |/ | | | | | | | | Example of running something as root on top of a parent image. This is a regression test related to the PR #52109.
* / dockerTools.buildImage: fix two bugs introduced in ↵Darius Jahandarie2018-12-14
|/ | | | c88337c9aca9d91804da7d1d05960c88e17455c9
* dockerTools.buildImage: support using a layered image in fromImageGraham Christensen2018-12-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.