New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
dockerTools: use epoch for layers and mtime #281443
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like a good idea.
TODO:
- document this behavior in the manual
- add a release note in the breaking changes section
- web servers and perhaps other services can be sensitive to mtime
- e.g. when serving a store path, make sure your responses do not have a
Last-Modified
header
- e.g. when serving a store path, make sure your responses do not have a
- web servers and perhaps other services can be sensitive to mtime
- test in
nixos/tests/docker-tools.nix
- explain why the customization layer mtime is still impure, and/or fix that too (and => when it's configurable)
1905de9
to
13b5437
Compare
The UX improvement of a recent time is primarily for the image itself and seldom used for layers and individual file.
13b5437
to
cb9fe54
Compare
@@ -373,7 +373,7 @@ See [](#ex-dockerTools-buildLayeredImage-hello) to see how to do that. | |||
# Building a layered Docker image | |||
|
|||
The following package builds a layered Docker image that runs the `hello` executable from the `hello` package. | |||
The Docker image will have name `hello` and tag `latest`. | |||
The Docker image will have name `hello` and tag `latest`. The created image can have a current timestamp when setting the `created` parameter to "now" - this will only affect the image, not the individual layers. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not the place to add this information. The buildLayeredImage
section is a thin wrapper for the streamLayeredImage
section, which is where you should add the extra sentence instead.
Adding this information either in the general area for streamLayeredImage
(the content before the "Inputs" subheading) or in the documentation of the created
attribute seems fine to me.
Also, when moving the text, please make sure you put one sentence per line to make it easier to review documentation. See https://github.com/NixOS/nixpkgs/blob/master/doc/README.md#documentation-conventions
Note for whoever merges this (or for myself after it's merged): please close #255396 since it conflicts with these changes. |
@@ -49,6 +49,8 @@ The pre-existing [services.ankisyncd](#opt-services.ankisyncd.enable) has been m | |||
|
|||
- `himalaya` was updated to v1.0.0-beta, which introduces breaking changes. Check out the [release note](https://github.com/soywod/himalaya/releases/tag/v1.0.0-beta) for details. | |||
|
|||
- `dockerTools.streamLayeredImage` created layers with mtimes using the "now" argument for the `created` parameter. It now uses UNIX time of "1" for the mtime of layers. It will still use "now" for the last customization layer and for setting the creation date of the image itself. This leads to greater re-use of layers between different images. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- `dockerTools.streamLayeredImage` created layers with mtimes using the "now" argument for the `created` parameter. It now uses UNIX time of "1" for the mtime of layers. It will still use "now" for the last customization layer and for setting the creation date of the image itself. This leads to greater re-use of layers between different images. | |
- `dockerTools.streamLayeredImage` previously created layers with mtimes using the "now" argument for the `created` parameter. It now uses UNIX time of "1" for the mtime of layers. It will still use "now" for the last customization layer and for setting the creation date of the image itself. This leads to greater re-use of layers between different images. |
The UX improvement of a recent time is primarily for the image itself and seldom used for layers and individual file.
Description of changes
The discussion in #47005 is about the date of an image, but there is far less usage of the time of a layer. This change makes all layers use epoch as mtime and for creation date, but still allows for overriding with "now" for the image itself. The intent is to allow greater re-use of image layers in a container storage subsystem.
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 馃憤 reaction to pull requests you find important.