func copyExistingContents(source, destination string) error {
	if destination == "" { // Empty destination means that this is a special mount which will get mounted inside the container
		return nil
	}
	volList, err := ioutil.ReadDir(source)
	if err != nil {
		return err
	}
	if len(volList) > 0 {
		srcList, err := ioutil.ReadDir(destination)
		if err != nil {
			return err
		}
		if len(srcList) == 0 {
			// If the source volume is empty copy files from the root into the volume
			if err := chrootarchive.CopyWithTar(source, destination); err != nil {
				return err
			}
		}
	}
	return copyOwnership(source, destination)
}
// copyExistingContents copies from the source to the destination and
// ensures the ownership is appropriately set.
copyExistingContents copies from the source to the destination and
ensures the ownership is appropriately set.
// copyExistingContents copies from the source to the destination and // ensures the ownership is appropriately set .
func copyExistingContents(source, destination string) error {
	if destination == "" { 
		return nil
	}
	volList, err := ioutil.ReadDir(source)
	if err != nil {
		return err
	}
	if len(volList) > 0 {
		srcList, err := ioutil.ReadDir(destination)
		if err != nil {
			return err
		}
		if len(srcList) == 0 {
			if err := chrootarchive.CopyWithTar(source, destination); err != nil {
				return err
			}
		}
	}
	return copyOwnership(source, destination)
}
func copyExistingContents ( source , destination string ) error { if destination == " " { return nil } volList , err := ioutil . ReadDir ( source ) if err != nil { return err } if len ( volList ) > 0 { srcList , err := ioutil . ReadDir ( destination ) if err != nil { return err } if len ( srcList ) == 0 { if err := chrootarchive . CopyWithTar ( source , destination ) ; err != nil { return err } } } return copyOwnership ( source , destination ) }
copyExistingContents copies from the source to the destination and
ensures the ownership is appropriately set.
copyExistingContents copies from the source to the destination and ensures the ownership is appropriately set .
// Empty destination means that this is a special mount which will get mounted inside the container // If the source volume is empty copy files from the root into the volume