Copy the content from the underlying image into the newly created volume.

Fixes: #10262

Signed-off-by: Vikas Goel <vikas.goel@gmail.com>
This commit is contained in:
Vikas Goel
2021-07-16 17:32:41 -07:00
committed by Vikas Goel
parent 20c9f74c77
commit 064bd9d19f
3 changed files with 162 additions and 1 deletions

View File

@ -153,7 +153,15 @@ func MakeContainer(ctx context.Context, rt *libpod.Runtime, s *specgen.SpecGener
if err != nil {
return nil, err
}
return rt.NewContainer(ctx, runtimeSpec, options...)
ctr, err := rt.NewContainer(ctx, runtimeSpec, options...)
if err != nil {
return ctr, err
}
// Copy the content from the underlying image into the newly created
// volume if configured to do so.
return ctr, rt.PrepareVolumeOnCreateContainer(ctx, ctr)
}
func extractCDIDevices(s *specgen.SpecGenerator) []libpod.CtrCreateOption {