3
0
Fork 0
forked from mirrors/nixpkgs
Commit graph

749 commits

Author SHA1 Message Date
Florian Klink ec6af332b4
Merge pull request #49240 from flokli/layered-docker-images-18.09
[18.09] layered docker images
2018-10-29 14:25:08 +00:00
Graham Christensen fbb61c14a2 dockerTools.buildLayeredImage: init
Create a many-layered Docker Image.

Implements much less than buildImage:

 - Doesn't support specific uids/gids
 - Doesn't support runninng commands after building
 - Doesn't require qemu
 - Doesn't create mutable copies of the files in the path
 - Doesn't support parent images

If you want those feature, I recommend using buildLayeredImage as an
input to buildImage.

Notably, it does support:

 - Caching low level, common paths based on a graph traversial
   algorithm, see referencesByPopularity in
   0a80233487993256e811f566b1c80a40394c03d6
 - Configurable number of layers. If you're not using AUFS or not
   extending the image, you can specify a larger number of layers at
   build time:

       pkgs.dockerTools.buildLayeredImage {
         name = "hello";
         maxLayers = 128;
         config.Cmd = [ "${pkgs.gitFull}/bin/git" ];
       };

 - Parallelized creation of the layers, improving build speed.
 - The contents of the image includes the closure of the configuration,
   so you don't have to specify paths in contents and config.

   With buildImage, paths referred to by the config were not included
   automatically in the image. Thus, if you wanted to call Git, you
   had to specify it twice:

       pkgs.dockerTools.buildImage {
         name = "hello";
         contents = [ pkgs.gitFull ];
         config.Cmd = [ "${pkgs.gitFull}/bin/git" ];
       };

   buildLayeredImage on the other hand includes the runtime closure of
   the config when calculating the contents of the image:

       pkgs.dockerTools.buildImage {
         name = "hello";
         config.Cmd = [ "${pkgs.gitFull}/bin/git" ];
       };

Minor Problems

 - If any of the store paths change, every layer will be rebuilt in
   the nix-build. However, beacuse the layers are bit-for-bit
   reproducable, when these images are loaded in to Docker they will
   match existing layers and not be imported or uploaded twice.

Common Questions

 - Aren't Docker layers ordered?

   No. People who have used a Dockerfile before assume Docker's
   Layers are inherently ordered. However, this is not true -- Docker
   layers are content-addressable and are not explicitly layered until
   they are composed in to an Image.

 - What happens if I have more than maxLayers of store paths?

   The first (maxLayers-2) most "popular" paths will have their own
   individual layers, then layer #(maxLayers-1) will contain all the
   remaining "unpopular" paths, and finally layer #(maxLayers) will
   contain the Image configuration.

(cherry picked from commit 4fe9006190)
(cherry picked from commit d1e46df24b)
2018-10-27 12:03:38 +01:00
Jörg Thalheim c2ad4bfbc0
Merge pull request #49099 from Mic92/breakpoint-backport
Backport breakpointHook [18.09]
2018-10-26 12:22:20 +01:00
Jörg Thalheim fcca8103db
doc: extend breakpointHook documentation
(cherry picked from commit 7f80fb2db4)
2018-10-26 11:15:28 +01:00
Raphael Borun Das Gupta 61aa2be8ad
nixpkgs docs: add missing spaces between words
(cherry picked from commit aa77e3aa4f)
2018-10-26 09:14:15 +01:00
Raphael Borun Das Gupta 7008cd8acd
nixpkgs docs: remove spurious ">"
(cherry picked from commit bea0b3021c)
2018-10-26 09:14:14 +01:00
Trolli Schmittlauch dbc3d6fdd9
clarifying name arg determines vim command name
The `name` arg of `vim_configurable.customize` does not only determine
the package name, but also the name of the command/ executable to be
called.
In my opinion this is not documented properly and finding that out took
me several hours.
2018-10-25 17:51:36 +01:00
Jörg Thalheim ccd398f2e4
doc/breakpointHook: add documentation
(cherry picked from commit 325a5699cb)
2018-10-25 14:09:35 +01:00
Graham Christensen c8342644cf
nixpkgs docs: document recursivelyUpdate
(cherry picked from commit 0eb3b93e1a)
2018-10-12 16:55:18 -04:00
Graham Christensen c30b39cfb1
nixpkgs docs: document recursivelyUpdateUntil
(cherry picked from commit c100a456b1)
2018-10-12 16:55:18 -04:00
Graham Christensen 1682621057
nixpkgs docs: document zipAttrs
(cherry picked from commit 77140a9075)
2018-10-12 16:55:18 -04:00
Graham Christensen a02495dd47
nixpkgs docs: document zipAttrsWith
(cherry picked from commit 655a5fa8bf)
2018-10-12 16:55:17 -04:00
Graham Christensen 66ce692e62
nixpkgs docs: Clarify zipAttrsWithNames's docs
(cherry picked from commit 4edb31882c)
2018-10-12 16:55:17 -04:00
Graham Christensen b8f712ef61
nixpkgs docs: document zipAttrsWithNames
(cherry picked from commit 3b3bde463b)
2018-10-12 16:07:14 -04:00
Graham Christensen 8b02f90f3a
nixpkgs docs: document optionalAttrs
(cherry picked from commit e0c6981d19)
2018-10-12 16:07:14 -04:00
Graham Christensen 3736fcdc64
nixpkgs docs: document toDerivation
(cherry picked from commit c547c3fe82)
2018-10-12 16:07:13 -04:00
Graham Christensen 1280a227f3
nixpkgs docs: document isDerivation
(cherry picked from commit f85a4ba9c3)
2018-10-12 16:07:13 -04:00
Graham Christensen 16c53e041b
nixpkgs docs: document genAttrs
(cherry picked from commit ef05e1057b)
2018-10-12 16:07:13 -04:00
Graham Christensen 27b549342b
nixpkgs docs: document mapAttrsRecursiveCond
(cherry picked from commit d664b8f5e3)
2018-10-12 16:07:12 -04:00
Graham Christensen 45dbf83bbc
nixpkgs docs: finish up mapAttrsRecursive
(cherry picked from commit e7549b96ad)
2018-10-12 16:07:12 -04:00
Graham Christensen d916a0f9ce
docs: Delete assert functions since they don't exist in 18.09 2018-10-05 13:18:04 -04:00
Graham Christensen 3bf2c2f2d1
Generate links to function definitions
Hydra passes the full revision in to the input, which we pass through.

If we don't get this ,we try to get it from other sources, or default to
master which should have the definition in a close-ish location.

All published docs should have theURL resolve properly, only local
hackers will have the link break.

(cherry picked from commit 5daee73ce4)
2018-10-05 13:14:11 -04:00
Graham Christensen 131cb302ab
nixpkgs: Start documenting library functions in XML
Covers assert functions and about half of the attrsets functions.

Some internal consistency around IDs could be improved.

(cherry picked from commit f835f77e02)
2018-10-05 10:20:39 -04:00
Graham Christensen e13c208665
nixpkgs docs: format 2018-10-03 22:01:16 -04:00
Graham Christensen 4a0da7f3ac
nixpkgs docs: Rebuild manual-full if nested XML docs change 2018-10-03 22:00:29 -04:00
Graham Christensen ce5e6466b6
shell functions: rewrite as xml 2018-10-03 22:00:29 -04:00
Graham Christensen 5954454dd1
nixpkgs docs: move shell section to its own file 2018-10-03 22:00:28 -04:00
Graham Christensen 7413dce611
nixpkgs docs: move dockertool to its own file 2018-10-03 22:00:27 -04:00
Graham Christensen 191745989c
nixpkgs docs: move fhs-environments to its own file 2018-10-03 21:58:37 -04:00
Graham Christensen 05519f21fc
nixpkgs docs: move debug to its own file 2018-10-03 21:58:37 -04:00
Graham Christensen b66df5c45d
nixpkgs docs: move generators to its own file 2018-10-03 21:58:37 -04:00
Graham Christensen 3b739c0daf
nixpkgs docs: move overrides to its own file 2018-10-03 21:57:26 -04:00
Uli Baum 04b04e9745 Merge branch 'release-18.09' into staging-18.09 2018-09-25 00:07:47 +02:00
John Ericson c896936cd1
Merge pull request #47299 from obsidiansystems/overrideScope-order
lib: Deprecate `overrideScope` in lieu of `overrideScope'` taking arguments in the conventional order for 18.09
2018-09-24 18:04:35 -04:00
John Ericson b9dce11712 lib: Make overrideScope' which takes arguments in the conventional order
The `overrideScope` bound by `makeScope` (via special `callPackage`)
took an override in the form `super: self { … }`. But this is
dangerously close to the `self: super { … }` form used by *everything*
else, even other definitions of `overrideScope`! Since that
implementation did not even share any code either until I changed it
recently in 3cf43547f4, this inconsistency
is almost certainly an oversight and not intentional.

Unfortunately, just as the inconstency is hard to debug if one just
assumes the conventional order, any sudden fix would break existing
overrides in the same hard-to-debug way. So instead of changing the
definition a new `overrideScope'` with the conventional order is added,
and old `overrideScope` deprecated with a warning saying to use
`overrideScope'` instead. That will hopefully get people to stop using
`overrideScope`, freeing our hand to change or remove it in the future.
2018-09-24 17:50:11 -04:00
John Ericson 8b60c7d088 doc: Don't mention top-level {build, host, target}Platform
For technical reasons, we cannot easily add a warning to top-level
definitions, so 2a6e4ae49a and
e51f736076 reverted the deprecation. But
we can still remove mention of the would-be deprecated definitions to
steer people towards using the preferred alternatives.

(cherry picked from commit e39a73cc55)
2018-09-23 13:29:08 -04:00
Vladimír Čunát 317ce1b622
Merge: nixos/weechat backports
Close #46861 - it's exactly the same commits, just with -x annotations.
2018-09-23 10:41:01 +02:00
Maximilian Bosch 27c2215684
weechat: 2.1 -> 2.2; improve package configuration
This aims to make the `weechat` package even more configurable. It
allows to specify scripts and commands using the `configure` function
inside a `weechat.override` expression.

The package can be configured like this:

```
with import <nixpkgs> { };
weechat.override {
  plugins = { availablePlugins, ... }: {
    plugins = builtins.attrValues availablePlugins;

    init = ''
      /set foo bar
      /server add freenode chat.freenode.org
    '';

    scripts = [ "/path/to/script.py" ];
  };
}
```

All commands are passed to `weechat --run-command "/set foo bar;/server ..."`.

The `plugins' attribute is not necessarily required anymore, if it's
sufficient to add `init' commands, the `plugins' will be
`builtins.attrValues availablePlugins' by default.

Additionally the result contains `weechat` and `weechat-headless`
(introduced in WeeChat 2.1) now.

(cherry picked from commit a8efe61412)
2018-09-23 10:33:56 +02:00
Graham Christensen a84a302732
Clarfy the binary reproducibility problems of created=now with dockerTools.buildImage.
(cherry picked from commit 7736337916)
2018-09-20 20:31:52 -04:00
Graham Christensen 0fe015a70c
dockerTools.buildImage: support impure dates
Because dates are an impurity, by default buildImage will use a static
date of one second past the UNIX Epoch. This can be a bit frustrating
when listing docker images in the CLI:

    $ docker image list
    REPOSITORY   TAG      IMAGE ID       CREATED        SIZE
    hello        latest   08c791c7846e   48 years ago   25.2MB

If you want to trade the purity for a better user experience, you can
set created to now.

    pkgs.dockerTools.buildImage {
      name = "hello";
      tag = "latest";
      created = "now";
      contents = pkgs.hello;

      config.Cmd = [ "/bin/hello" ];
    }

and now the Docker CLI will display a reasonable date and sort the
images as expected:

    $ docker image list
    REPOSITORY   TAG      IMAGE ID       CREATED              SIZE
    hello        latest   de2bf4786de6   About a minute ago   25.2MB

(cherry picked from commit a32d7e0c74)
2018-09-20 20:31:51 -04:00
worldofpeace 3ac0a6c74a rust.section.md: remove nixcrate reference
nixcrate is deprecated

(cherry picked from commit 6dae5de436)
2018-09-15 19:46:35 +01:00
Sarah Brofeldt ea4d36a2e5 Revert "top-level: Deprecate top-level {build,host,target}Platform"
This reverts commit e51f736076.
2018-09-11 12:07:22 +02:00
Jörg Thalheim 7490ec9ed3 doc/vim: improve plugin documentation
(cherry picked from commit 97acac9a81)
2018-09-09 14:15:52 +01:00
John Ericson e51f736076 top-level: Deprecate top-level {build,host,target}Platform
I don't know when we can/should remove them, but this at least gets
people to stop using them. The preferred alternatives also date back to
17.09 so writing forward-compatable code without extra conditions is
easy.

Beginning with these as they are the least controversial.
2018-09-05 11:53:51 -04:00
Graham Christensen 03b89e3031
Merge pull request #45914 from grahamc/section-ids
Section ids
2018-09-01 15:38:52 -04:00
Graham Christensen 2eea92a1dc
nixpkgs docs: give linked things IDs 2018-09-01 15:20:57 -04:00
Graham Christensen cbdcf81590
Add section IDs 2018-09-01 15:06:38 -04:00
Jörg Thalheim 4a74aca868
Merge pull request #45700 from Mic92/node-packages-v8
nodePackages: 6_x -> 8_x
2018-09-01 09:09:24 +01:00
Daiderd Jordan 477efb9d87
Merge pull request #42464 from LnL7/manual-installcheck
doc: add installCheckTarget and installCheckFlags to manual
2018-08-31 20:08:16 +02:00
John Ericson 2c4a75e9ef
Merge pull request #45820 from obsidiansystems/dont-use-obsolete-platform-aliases
treewide: Dont use obsolete platform aliases
2018-08-31 09:56:10 -04:00