about summary refs log tree commit diff
path: root/pkgs/build-support/docker
AgeCommit message (Collapse)AuthorFilesLines
2024-04-08Merge pull request #292760 from PigeonF/dockertools-build-layered-compressorRobert Hensing2-3/+19
dockerTools: Fix changing compression method for `buildLayeredImage`
2024-03-27Merge pull request #297496 from abryko/docker-tag-discard-closureRyan Lahfa1-2/+2
dockerTools: discard closure reference in imageTag
2024-03-23Merge pull request #298239 from cdepillabout/layered-img-passthruPol Dellaiera1-1/+1
dockerTools: add streamed image as passthru to buildLayeredImage
2024-03-23dockerTools: add streamed image as passthru to buildLayeredImageDennis Gosnell1-1/+1
This is convenient for debugging the underlying streamed image used by `dockerTools.buildLayeredImage`. Here's an example of how you might use this: ```console $ nix repl ./. nix-repl> dockerTools.examples.nginx.passthru.stream «derivation /nix/store/9zczmlp2kraszx4ssmh6fawnlnsa5a4n-stream-nginx-container.drv» ```
2024-03-20dockerTools: discard closure reference in imageTagXavier Maillard1-2/+2
2024-03-19Merge pull request #178717 from ShamrockLee/write-multiple-referencesSomeone1-2/+2
trivial-builders: replace writeReferencesToFile with writeClosure
2024-03-19treewide: add meta.mainProgram to packages with a single binarystuebinm2-0/+2
The nixpkgs-unstable channel's programs.sqlite was used to identify packages producing exactly one binary, and these automatically added to their package definitions wherever possible.
2024-03-19dockerTools.buildImage: writeReferencesToFile -> writeClosureYueh-Shun Li1-2/+2
2024-03-12Merge pull request #292259 from dawidd6/docker-nix-sslSilvan Mosberger1-0/+1
dockerTools: set NIX_SSL_CERT_FILE in image
2024-03-02dockerTools: Do not pass `compressor` to `streamLayeredImage`Jonas Fierlings1-2/+2
2024-03-02dockerTools: Test changing compression of `buildLayeredImage`Jonas Fierlings1-1/+17
2024-02-29Merge pull request #289840 from PigeonF/masterPol Dellaiera1-0/+2
Make `dockerTools.buildImageWithNixDb` reproducible
2024-02-29dockerTools: set NIX_SSL_CERT_FILE in imageDawid Dziurla1-0/+1
2024-02-26Remove the redundant comments from streamLayeredImage parametersWxNzEMof1-34/+14
The proper place to describe them is the documentation, where they are described thoroughly.
2024-02-26streamLayeredImage: Change mode of /nix, /nix/store to 755WxNzEMof1-1/+1
The change is insignificant when the owner is root. However, when it is not root, this change is needed to allow using Nix (as an unprivileged user) inside the container.
2024-02-26streamLayeredImage: Allow customizing ownershipWxNzEMof2-12/+32
This opens the way towards building images where Nix can be used as an unprivileged user (in single-user mode).
2024-02-19Merge pull request #289584 from athre0z/docker-zstdRobert Hensing2-14/+87
dockerTools: configurable compression schema
2024-02-18nixos/dockerTools: make buildImageWithNixDb reproduciblepigeon1-0/+2
The loaded database contains timestamps of when the nix paths were registered. Depending on the host store, these can differ between runs. Resetting them to a well known values ensures that the produced image is reproducible.
2024-02-17dockerTools: configurable compression schemaJoel Höner2-14/+87
This commit adds support for swapping out the compression algorithm used in all major docker-tools commands that generate images. The default algorithm remains unchanged (gzip).
2024-02-14Merge pull request #271976 from r-k-b/fix-dockerTools-includeStorePathsRobert Hensing2-0/+15
nixos/dockerTools: fix includeStorePaths when enableFakechroot
2024-02-01doc: update environment helpers in dockerTools docs, add fakeNss sectionDS1-0/+1
Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
2024-01-23Use fakeroot for proot cmd in streamLayeredImageMatthew Planchard1-1/+1
Resolves #275705
2024-01-17nixosTests.docker-tools: Use both code paths in includeStorePath testRobert Hensing1-0/+13
2023-12-07nixos/dockerTools: fix includeStorePaths when enableFakechrootRobert K. Bell2-0/+2
After #268458, when setting `enableFakechroot = true` and `includeStorePaths = false`, some of the store paths were getting included into the image anyway, thru `bind-paths`. This resulted in unexpectedly large images. Now, the images will not contain any store paths under those circumstances.
2023-11-19nixos/dockerTools: fixup proot/fakeroot codeJörg Thalheim1-11/+24
Not sure how this ever worked but tar was trying to archive /proc and /sys, which failed to work. Since this is never useful for containers to do, we exclude this now in the proot case. Also fakeroot is not needed when proot is used as it provideds the same feature. We now cleanly seperate those cases as both are kind of hacks and it's more likely that the combination will just trigger new bugs.
2023-10-09dockerTools: create /tmp in rootLayerTim Windelschmidt1-1/+1
2023-09-11dockerTools: use makeOverridable for buildImage family of functionsRobert Scott1-6/+9
this allows nix users to modify existing images without having to rely on container image inheritance mechanisms via fromImage
2023-08-19dockerTools: replace fakechroot with prootViktor Kronvall1-10/+10
The command `fakechroot` errored with buffer overflows. The `proot` command doesn't seem to suffer from the same problem. The tar command creating the layer errors with "permission denied" on a bunch of paths in /proc but the layer seems to get built anyway.
2023-08-17dockerTools: replace --no-clobber with --update=noneViktor Kronvall1-1/+1
Since coreutils v9.2 the `--no-clobber` flag results in a non-zero exit code when the destination files exist. Using `--update=none` will now reproduce the old behavior of `--no-clobber`. However, the `--update=none` flag was introduced in coreutils v9.3 and thus `mergeImages` will fail if you have an older version than v9.3 in stdenv after applying this commit. [coreutils v9.3 changelog](https://github.com/coreutils/coreutils/blob/f386722dc0d996d5379f12b4a8d4dd15ca7df4b5/NEWS#L48)
2023-06-24treewide: use optionalString instead of 'then ""'Felix Buehler1-1/+1
2023-04-03nix-prefetch-docker: handle overrides correctlyRobin Bate Boerop1-1/+1
Without this change, the `--os` and `--arch` switches are disregarded for operations involving `skopeo inspect` invocations. This means that, for example, one cannot fetch Linux images while on macOS.
2023-03-13treewide: Make yescrypt the default algorithm for pam_unix.soMartin Weinelt1-1/+1
This ensures `passwd` will default to yescrypt for newly generated passwords.
2023-02-06dockerTools: Preprocess layers list before unpack to handle repeated layersAndrew Brooks1-3/+12
2023-02-03dockerTools: Correctly unpack duplicate rootfs diffsAndrew Brooks1-1/+2
This PR addresses issue #214434 by preventing dockerTools.buildImage from deleting rootfs diffs until after they've been unpacked.
2022-12-23dockerTools: make gzipped docker images faster to update by rsyncWalter Franzini1-4/+4
This passes --rsyncable / -R to pigz for input-determined block locations, to improve rsync-ability.
2022-12-17treewide: fix typosfigsoda1-1/+1
2022-12-08nixosTests.docker-tools: Fix nginx testRobert Hensing1-1/+1
2022-12-08dockerTools: refactor, rename internal variableRobert Hensing1-4/+4
> has to fit its domain, which is the OCI spec, which uses > `architecture`. The `defaultArch` and `GOARCH` names are irrelevant.
2022-12-08dockerTools: allowing architecture to be specifiedChristian Kemper2-6/+23
... for buildImage, buildLayeredImage and streamLayeredImage, adding docs and tests.
2022-11-30dockerTools: fix nginx testIzorkin1-1/+2
2022-11-27dockerTools: fixup evaluation without allowed aliasesVladimír Čunát1-1/+0
This is a regression from PR #172736
2022-11-26Merge pull request #172736 from infinisil/docker-nix-shellSilvan Mosberger2-2/+302
2022-11-18dockerTools: prefer local buildsmupdt1-1/+7
2022-11-07dockerTools.buildNixShellImage: Chown nix directoriesSilvan Mosberger1-3/+6
To the user running the docker image. If a Nix binary is available in the resulting derivation, this then behaves like a single-user Nix installation, except that already-written /nix/store paths can't be changed. Most notably it makes Nix work not have to rely on a chroot store in the image
2022-10-13Merge pull request #141050 from koenw/dockertools_too_many_argumentsRobert Hensing1-10/+11
build-support: Fix error when building images with many layers
2022-10-13build-support: Fix error when building images with many layersKoen Wilde1-10/+11
When building a docker image using `dockertools.buildLayeredImage`, the resulting image layers are passed to `jq` through the command line. When building an image with too many layers this would exceed the maximum command line argument length. Hence, we store the list of layers in the Nix store and pass them to `jq` as a file argument using `--slurpfile`. Fixes #140908.
2022-10-07nixos/tests: Add tests for dockerTools.buildNixShellImageSilvan Mosberger2-2/+116
2022-10-07Introduce dockerTools.buildNixShellImageSilvan Mosberger1-0/+183
2022-09-21nixosTests.docker-tools: Add image-with-certsRobert Hensing1-3/+2
2022-09-20dockerTools: add missing mkdir to caCertificates derivationRoss Light2-0/+19