I have a container which (after set up) is used as a new image. For this I am using lxc publish my-container --alias my-new-image --compression none. Now when I try to launch a new container using the newly created image, the image still needs to be unpacked:
Is there any way that this unpacking can be when publishing the image? I tried to set --compression none, because I thought this would skip the need to again unpack the image, but this did not change anything.
Am I missing something or is this just not possible?
The lxc publish command’s job is to take an existing instance and convert it into a compressed image file. This necessarily means that to use that image it needs to be decompressed to be used.
However, depending on the storage pool type you are using, the image will only be unpacked once, for the first instance created, and subsequent instances created using that image will re-use the unpacked image volume.
Indeed that is the case, it’s only the first start of a container the case.
Thanks for your link, that explains why doing a publish uncompressed doesn’t have an effect on the first container start. I thought there would be a way to do this already in the publish step. Right now I am doing something like