Skip to content
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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dockerTools: Fix Docker layers order #61089

Merged
merged 2 commits into from May 13, 2019
Merged

Conversation

nlewo
Copy link
Member

@nlewo nlewo commented May 7, 2019

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.

A test is added to avoid such kind of issues in the future.

Motivation for this change

Fix bad behavior of our Docker tooling.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

nlewo added 2 commits May 7, 2019 16:52
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.
@nlewo
Copy link
Member Author

nlewo commented May 7, 2019

@GrahamcOfBorg test docker-tools

Copy link
Member

@grahamc grahamc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nightmare code, but lgtm :)

@nlewo nlewo merged commit 42ee7cd into NixOS:master May 13, 2019
@nlewo
Copy link
Member Author

nlewo commented May 13, 2019

Tests passed on 19.03 and backported in 39d3dd4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants