You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: common.go
    path of file: ./repos/sealer/vendor/github.com/containers/buildah
    
    the code of the file until where you have to start completion: package buildah

import (
	"context"
	"io"
	"os"
	"path/filepath"
	"time"

	"github.com/containers/buildah/define"
	"github.com/containers/common/pkg/retry"
	cp "github.com/containers/image/v5/copy"
	"github.
    
func retryCopyImage(ctx context.Context, policyContext *signature.PolicyContext, dest, src, registry types.ImageReference, copyOptions *cp.Options, maxRetries int, retryDelay time.Duration) ([]byte, error) {
	var (
		manifestBytes []byte
		err           error
		lastErr       error
	)
	err = retry.RetryIfNecessary(ctx, func() error {
		manifestBytes, err = cp.Image(ctx, policyContext, dest, src, copyOptions)
		if registry != nil && registry.Transport().Name() != docker.Transport.Name() {
			lastErr = err
			return nil
		}
		return err
	}, &retry.RetryOptions{MaxRetry: maxRetries, Delay: retryDelay})
	if lastErr != nil {
		err = lastErr
	}
	return manifestBytes, err
}