singularity-tools.buildImages: use writeClosure
This commit is contained in:
parent
e28ad1a0a3
commit
5c1a3b619d
1 changed files with 2 additions and 7 deletions
|
@ -4,7 +4,7 @@
|
||||||
, storeDir ? builtins.storeDir
|
, storeDir ? builtins.storeDir
|
||||||
, writeScript
|
, writeScript
|
||||||
, singularity
|
, singularity
|
||||||
, writeReferencesToFile
|
, writeClosure
|
||||||
, bash
|
, bash
|
||||||
, vmTools
|
, vmTools
|
||||||
, gawk
|
, gawk
|
||||||
|
@ -50,18 +50,13 @@ rec {
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
projectName = singularity.projectName or "singularity";
|
projectName = singularity.projectName or "singularity";
|
||||||
layer = mkLayer {
|
|
||||||
inherit name;
|
|
||||||
contents = contents ++ [ bash runScriptFile ];
|
|
||||||
inherit projectName;
|
|
||||||
};
|
|
||||||
runAsRootFile = shellScript "run-as-root.sh" runAsRoot;
|
runAsRootFile = shellScript "run-as-root.sh" runAsRoot;
|
||||||
runScriptFile = shellScript "run-script.sh" runScript;
|
runScriptFile = shellScript "run-script.sh" runScript;
|
||||||
result = vmTools.runInLinuxVM (
|
result = vmTools.runInLinuxVM (
|
||||||
runCommand "${projectName}-image-${name}.img"
|
runCommand "${projectName}-image-${name}.img"
|
||||||
{
|
{
|
||||||
buildInputs = [ singularity e2fsprogs util-linux gawk ];
|
buildInputs = [ singularity e2fsprogs util-linux gawk ];
|
||||||
layerClosure = writeReferencesToFile layer;
|
layerClosure = writeClosure contents;
|
||||||
preVM = vmTools.createEmptyImage {
|
preVM = vmTools.createEmptyImage {
|
||||||
size = diskSize;
|
size = diskSize;
|
||||||
fullName = "${projectName}-run-disk";
|
fullName = "${projectName}-run-disk";
|
||||||
|
|
Loading…
Reference in a new issue