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: docker_mounts.go
    path of file: ./repos/testcontainers-go
    
    the code of the file until where you have to start completion: package testcontainers

import "github.com/docker/docker/api/types/mount"

var mountTypeMapping = map[MountType]mount.Type{
	MountTypeBind:   mount.TypeBind, // Deprecated, it will be removed in a future release
	MountTypeVolume: mount.TypeVolume,
	MountTypeTmpfs:  mount.TypeTmpfs,
	MountTypePipe:   mount.TypeNamedPipe,
}

// Deprecated: use Files or HostConfigModifier in the ContainerRequest, or copy files container APIs to make containers portable across Docker environments
// BindMounter can optionally be implemented by mount sources
// to support advanced scenarios based on mount.BindOptions
type BindMounter interface {
	GetBindOptions() *mount.BindOptions
}

// VolumeMounter can optionally be implemented by mount sources
// to support advanced scenarios based on mount.VolumeOptions
type VolumeMounter interface {
	GetVolumeOptions() *mount.VolumeOptions
}
    
func mapToDockerMounts(containerMounts ContainerMounts) []mount.Mount {
	mounts := make([]mount.Mount, 0, len(containerMounts))

	for idx := range containerMounts {
		m := containerMounts[idx]

		var mountType mount.Type
		if mt, ok := mountTypeMapping[m.Source.Type()]; ok {
			mountType = mt
		} else {
			continue
		}

		containerMount := mount.Mount{
			Type:     mountType,
			Source:   m.Source.Source(),
			ReadOnly: m.ReadOnly,
			Target:   m.Target.Target(),
		}

		switch typedMounter := m.Source.(type) {
		case VolumeMounter:
			containerMount.VolumeOptions = typedMounter.GetVolumeOptions()
		case TmpfsMounter:
			containerMount.TmpfsOptions = typedMounter.GetTmpfsOptions()
		case BindMounter:
			Logger.Printf("Mount type %s is not supported by Testcontainers for Go", m.Source.Type())
		default:
			// The provided source type has no custom options
		}

		if mountType == mount.TypeVolume {
			if containerMount.VolumeOptions == nil {
				containerMount.VolumeOptions = &mount.VolumeOptions{
					Labels: make(map[string]string),
				}
			}
			for k, v := range GenericLabels() {
				containerMount.VolumeOptions.Labels[k] = v
			}
		}

		mounts = append(mounts, containerMount)
	}

	return mounts
}