def create_volume_for_marqo_version(self, version: str, volume_name: str = None) -> str:
        """
        Create a Docker volume for the specified Marqo version.

        This function replaces dots with underscores in the version string to format the volume name.
        If no volume name is provided, it generates one based on the version.

        Args:
            version (str): The version of the Marqo container.
            volume_name (str): The name of the Docker volume to create. If None, a name is generated based on the version.

        Returns:
            str: The name of the created Docker volume.

        Raises:
            RuntimeError: If there is an error during the Docker volume creation process.
        """
        # Generate a volume name if not provided
        if volume_name is None:
            volume_name = self.get_volume_name_from_marqo_version(version)

        # Create the Docker volume
        try:
            self.logger.debug(f"Creating Docker volume: {volume_name}")
            self.docker_client.volumes.create(name=volume_name)
            self.volumes_to_cleanup.add(volume_name)
            self.logger.info(f"Successfully created volume: {volume_name}")
            return volume_name
        except APIError as e:
            self.logger.exception(f"Failed to create Docker volume: {volume_name}")
            raise RuntimeError(f"Failed to create volume: {volume_name}") from e

        Create a Docker volume for the specified Marqo version.

        This function replaces dots with underscores in the version string to format the volume name.
        If no volume name is provided, it generates one based on the version.

        Args:
            version (str): The version of the Marqo container.
            volume_name (str): The name of the Docker volume to create. If None, a name is generated based on the version.

        Returns:
            str: The name of the created Docker volume.

        Raises:
            RuntimeError: If there is an error during the Docker volume creation process.
        
tests/compatibility_tests/docker_manager.py