dockerTools: Add example of using NixOS' etc#175474
Merged
roberth merged 2 commits intoNixOS:masterfrom Jun 22, 2022
Merged
Conversation
(cherry picked from commit 9b2af86)
/etc/hosts is generally also provided by the container runtime.
roberth
commented
May 30, 2022
| enableFakechroot = true; | ||
| fakeRootCommands = '' | ||
| mkdir -p /etc | ||
| ${nixosCore.config.system.build.etcActivationCommands} |
Member
Author
There was a problem hiding this comment.
We should have a function in dockerTools that just takes a module and runs the whole activation script, but I don't think the modules are in a state to support that yet. Until then, this is the best we can do.
06kellyjac
reviewed
May 30, 2022
| ) | ||
|
|
||
| with subtest("etc"): | ||
| docker.succeed("${examples.etc} | docker load") |
Member
There was a problem hiding this comment.
Does this not need to be
Suggested change
| docker.succeed("${examples.etc} | docker load") | |
| docker.succeed("cat ${examples.etc} | docker load") |
or
Suggested change
| docker.succeed("${examples.etc} | docker load") | |
| docker.succeed("docker load -i ${examples.etc}") |
?
Member
Author
There was a problem hiding this comment.
It's actually a script, so the current thing works.
It's more efficient to use streamLayeredImage than buildLayeredImage because we don't have to store and later GC the image.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of changes
(cherry picked from commit 9b2af86)
#148456 came up again; figured I'd try to make some progress again.
Things done
sandbox = trueset innix.conf? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)nixos/doc/manual/md-to-db.shto update generated release notes