dockerTools: Support files directly under /nix/store

Also makes sure that the files inside a layer added in a sorted order
to make the results more deterministic.
This commit is contained in:
Utku Demir
2020-07-04 22:00:57 +12:00
parent f6ef771ab9
commit cc46362929
3 changed files with 20 additions and 4 deletions
+10
View File
@@ -335,4 +335,14 @@ rec {
};
};
# 19. Support files in the store on buildLayeredImage
# See: https://github.com/NixOS/nixpkgs/pull/91084#issuecomment-653496223
filesInStore = pkgs.dockerTools.buildLayeredImage {
name = "file-in-store";
tag = "latest";
config.Cmd = [
"${pkgs.coreutils}/bin/cat"
(pkgs.writeText "somefile" "some data")
];
};
}