Description
openedon Jul 23, 2020
It seems that hcsshim.CreateScratchLayer(.., someDir, "<unused>", [])
simply creates the directory, but does not set up a sandbox.vhdx
or similar. I tested this with a slightly-modified wclayer
to make the parents list for wclayer create
optional.
Is there any way to create a functional scratch layer without needing to base it on an existing image? This appears to be a blocker for #750, and the lack of it creates complications in containerd WCOW support since I cannot just treat every snapshot as a WCOW layer, but must juggle plain directories and WCOW layers with sandbox.vhdx and WCOW layers without sandbox.vhdx.
The ability to create an empty scratch layer would simplify this, by letting me use WCOW layers for all use-cases, and never needing to symlink anything, resolving an open question on containerd/containerd#2366
Also, it seems hcsshim.CreateLayer
always seems to just create an empty directory no matter what I pass it. I assume that if it was doing anything behind-the-scenes, it would be safe to import layer data from an OCI tarball into the resulting directory.
I did a quick test, and hcsshim.CreateLayer
even with a parents list does not seem to result in something suitable for the parents list of PrepareLayer
, so I guess you must import a tarball into that directory?