From 064bd9d19f30467ffb8f626b6eb13101a12c0ed6 Mon Sep 17 00:00:00 2001 From: Vikas Goel Date: Fri, 16 Jul 2021 17:32:41 -0700 Subject: Copy the content from the underlying image into the newly created volume. Fixes: #10262 Signed-off-by: Vikas Goel --- pkg/specgen/generate/container_create.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'pkg') diff --git a/pkg/specgen/generate/container_create.go b/pkg/specgen/generate/container_create.go index b569f8390..4e3a86ae4 100644 --- a/pkg/specgen/generate/container_create.go +++ b/pkg/specgen/generate/container_create.go @@ -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 { -- cgit v1.2.3-54-g00ecf