dockerTools.runWithOverlay: Avoid cluttering $out and copying

This commit is contained in:
Robert Hensing 2021-09-29 09:34:06 +02:00
parent 8863a5199d
commit 63bf4539b9

View File

@ -191,13 +191,13 @@ rec {
, postMount ? ""
, postUmount ? ""
}:
let
result = vmTools.runInLinuxVM (
vmTools.runInLinuxVM (
runCommand name
{
preVM = vmTools.createEmptyImage {
size = diskSize;
fullName = "docker-run-disk";
destination = "./image";
};
inherit fromImage fromImageName fromImageTag;
@ -278,16 +278,6 @@ rec {
${postUmount}
'');
in
runCommand name { } ''
cd ${result}
if [ -e json ] && [ -e VERSION ] ; then
mkdir -p $out
cp layer.tar json VERSION $out
else
cp layer.tar $out
fi
'';
exportImage = { name ? fromImage.name, fromImage, fromImageName ? null, fromImageTag ? null, diskSize ? 1024 }:
runWithOverlay {