diff --git a/pkg/fanal/test/integration/docker/docker.go b/pkg/fanal/test/integration/docker/docker.go index 13ba250d4444..772aef0778f2 100644 --- a/pkg/fanal/test/integration/docker/docker.go +++ b/pkg/fanal/test/integration/docker/docker.go @@ -81,6 +81,7 @@ func (d Docker) ReplicateImage(ctx context.Context, imageRef, imagePath string, if err != nil { return err } + defer testfile.Close() // load image into docker engine resp, err := d.cli.ImageLoad(ctx, testfile, true)