public List<String> createVolumesAsPerVolumeBinds(ServiceHub hub, List<String> binds, List<VolumeConfiguration> volumes)
            throws DockerAccessException {

        Map<String, Integer> indexMap = new HashMap<>();
        List<String> volumesCreated = new ArrayList<>();

        for (int index = 0; index < volumes.size(); index++) {
            indexMap.put(volumes.get(index).getName(), index);
        }

        for (String bind : binds) {
            if (bind.contains(":")) {
                String name = bind.substring(0, bind.indexOf(':'));
                Integer volumeConfigIndex = indexMap.get(name);
                if (volumeConfigIndex != null) {
                    VolumeConfiguration volumeConfig = volumes.get(volumeConfigIndex);
                    hub.getVolumeService().createVolume(volumeConfig);
                    volumesCreated.add(volumeConfig.getName());
                }
            }
        }

        return volumesCreated;
    }
Creates a Volume if a volume is referred to during startup in bind mount mapping and
a VolumeConfiguration exists

@param hub Service hub
@param binds volume binds present in ImageConfiguration
@param volumes VolumeConfigs present
@return List of volumes created
@throws DockerAccessException
src/main/java/io/fabric8/maven/docker/service/RunService.java