Creating a container after publishing the image


I have noticed that after publishing an image from a container, it takes a while to create the first container from that image (around 30 sec in my case). All subsequent containers are created much faster (1s). Is there a way to speed up first container creation?


This will be because the storage pool you’re using supports optimized image volumes and so the first time you use an image on a storage pool it unpacks the image into a fresh volume and then subsequent instances are created from snapshots of it.

If you use a storage pool driver that doesn’t support optimized image volume snapshots you’ll find the slow speed is the same on every instance launch.

The first container causes the image to get unpacked and stored in the storage backend.
If that storage backend supports CoW, subsequent launches are very fast.

This is the same whether it’s a local or remote image. One way to speed it up is to create a dummy container from the image right after you publish it, then delete it.

@tomp, @stgraber Thanks for the comments! I have been using “dummy” container for some time already to address it, but was wondering if there was a “proper” way of doing it.