dockerTools: Verify nix-store contents on buildLayeredImage test

This commit is contained in:
Utku Demir
2020-07-06 16:59:58 +12:00
parent 2ae2186dfd
commit 06db331922
2 changed files with 16 additions and 6 deletions
+13 -4
View File
@@ -337,12 +337,21 @@ rec {
# 19. Support files in the store on buildLayeredImage
# See: https://github.com/NixOS/nixpkgs/pull/91084#issuecomment-653496223
filesInStore = pkgs.dockerTools.buildLayeredImage {
filesInStore = pkgs.dockerTools.buildLayeredImageWithNixDb {
name = "file-in-store";
tag = "latest";
config.Cmd = [
"${pkgs.coreutils}/bin/cat"
(pkgs.writeText "somefile" "some data")
contents = [
pkgs.coreutils
pkgs.nix
(pkgs.writeScriptBin "myscript" ''
#!${pkgs.runtimeShell}
cat ${pkgs.writeText "somefile" "some data"}
'')
];
config = {
Cmd = [ "myscript" ];
# For some reason 'nix-store --verify' requires this environment variable
Env = [ "USER=root" ];
};
};
}