# Buggy code
def _get_container_create_options(
    self, override_options, number, one_off=False, previous_container=None
):
    add_config_hash = not one_off and not override_options

    container_options = dict(
        (k, self.options[k]) for k in DOCKER_CONFIG_KEYS if k in self.options
    )
    override_volumes = override_options.pop("volumes", [])
    container_options.update(override_options)

    if not container_options.get("name"):
        container_options["name"] = self.get_container_name(self.name, number, one_off)

    container_options.setdefault("detach", True)

    # If a qualified hostname was given, split it into an
    # unqualified hostname and a domainname unless domainname
    # was also given explicitly. This matches behavior
    # until Docker Engine 1.11.0 - Docker API 1.23.
    if (
        version_lt(self.client.api_version, "1.23")
        and "hostname" in container_options
        and "domainname" not in container_options
        and "." in container_options["hostname"]
    ):
        parts = container_options["hostname"].partition(".")
        container_options["hostname"] = parts[0]
        container_options["domainname"] = parts[2]

    if (
        version_gte(self.client.api_version, "1.25")
        and "stop_grace_period" in self.options
    ):
        container_options["stop_timeout"] = self.stop_timeout(None)

    if "ports" in container_options or "expose" in self.options:
        container_options["ports"] = build_container_ports(
            formatted_ports(container_options.get("ports", [])), self.options
        )

    if "volumes" in container_options or override_volumes:
        container_options["volumes"] = list(
            set(container_options.get("volumes", []) + override_volumes)
        )

    container_options["environment"] = merge_environment(
        self.options.get("environment"), override_options.get("environment")
    )

    container_options["labels"] = merge_labels(
        self.options.get("labels"), override_options.get("labels")
    )

    container_volumes = []
    container_mounts = []
    if "volumes" in container_options:
        container_volumes = [
            v for v in container_options.get("volumes") if isinstance(v, VolumeSpec)
        ]
        container_mounts = [
            v for v in container_options.get("volumes") if isinstance(v, MountSpec)
        ]

    binds, affinity = merge_volume_bindings(
        container_volumes,
        self.options.get("tmpfs") or [],
        previous_container,
        container_mounts,
    )
    override_options["binds"] = binds
    container_options["environment"].update(affinity)

    container_options["volumes"] = dict(
        (v.internal, {}) for v in container_volumes or {}
    )
    override_options["mounts"] = [build_mount(v) for v in container_mounts] or None

    secret_volumes = self.get_secret_volumes()
    if secret_volumes:
        if version_lt(self.client.api_version, "1.30"):
            override_options["binds"].extend(v.legacy_repr() for v in secret_volumes)
            container_options["volumes"].update((v.target, {}) for v in secret_volumes)
        else:
            override_options["mounts"] = override_options.get("mounts") or []
            override_options["mounts"].extend([build_mount(v) for v in secret_volumes])

    container_options["image"] = self.image_name

    container_options["labels"] = build_container_labels(
        container_options.get("labels", {}),
        self.labels(one_off=one_off),
        number,
        self.config_hash if add_config_hash else None,
    )

    # Delete options which are only used in HostConfig
    for key in HOST_CONFIG_KEYS:
        container_options.pop(key, None)

    container_options["host_config"] = self._get_container_host_config(
        override_options, one_off=one_off
    )

    networking_config = self.build_default_networking_config()
    if networking_config:
        container_options["networking_config"] = networking_config

    container_options["environment"] = format_environment(
        container_options["environment"]
    )
    return container_options


# Traceback (docker.errors.InvalidVersion)
compose.cli.verbose_proxy.proxy_callable: docker create_host_config <- (device_read_iops=None, mem_swappiness=None, links=[], oom_score_adj=None, blkio_weight=None, cpu_count=None, cpuset_cpus=None, dns_search=None, pid_mode=None, init_path=None, log_config={'Type': u'', 'Config': {}}, cpu_quota=None, read_only=None, cpu_percent=None, device_read_bps=None, storage_opt=None, init=None, dns=None, volumes_from=[], ipc_mode=None, mem_reservation=None, security_opt=None, shm_size=None, device_write_iops=None, dns_opt=None, cgroup_parent=None, group_add=None, network_mode=u'cerebrom_default', volume_driver=None, oom_kill_disable=None, userns_mode=None, tmpfs=None, nano_cpus=None, port_bindings={'9600/tcp': [None]}, isolation=None, memswap_limit=None, restart_policy=None, blkio_weight_device=None, devices=None, extra_hosts=None, binds=[], sysctls=None, pids_limit=None, device_write_bps=None, cap_add=None, mounts=[{'Source': u'/home/wayne/projects/ormuco/cerebrom/docker/ormuco-vpn/credentials/vpnc', 'ReadOnly': None, 'Type': 'bind', 'Target': '/etc/vpnc'}, {'Source': u'/home/wayne/projects/ormuco/cerebrom/docker/ormuco-vpn/credentials/ssh', 'ReadOnly': None, 'Type': 'bind', 'Target': '/ssh'}], mem_limit=None, cap_drop=None, privileged=False, ulimits=None, cpu_shares=None)
compose.parallel.parallel_execute_iter: Failed: <Container: 21d4214f35f5_cerebrom_ormuco-vpn_1 (21d421)>
compose.parallel.feed_queue: Pending: set([])

ERROR: for 21d4214f35f5_cerebrom_ormuco-vpn_1  mounts param is not supported in API versions < 1.30
compose.parallel.parallel_execute_iter: Failed: <Service: ormuco-vpn>
compose.parallel.feed_queue: Pending: set([<Service: proctor>])
compose.parallel.feed_queue: <Service: proctor> has upstream errors - not processing
compose.parallel.parallel_execute_iter: Failed: <Service: proctor>
compose.parallel.feed_queue: Pending: set([])

ERROR: for ormuco-vpn  mounts param is not supported in API versions < 1.30
Traceback (most recent call last):
File "/home/wayne/.virtualenvs/cerebrom-5qiep0Vx/bin/docker-compose", line 11, in <module>
sys.exit(main())
File "/home/wayne/.virtualenvs/cerebrom-5qiep0Vx/local/lib/python2.7/site-packages/compose/cli/main.py", line 71, in main
command()
File "/home/wayne/.virtualenvs/cerebrom-5qiep0Vx/local/lib/python2.7/site-packages/compose/cli/main.py", line 124, in perform_command
handler(command, command_options)
File "/home/wayne/.virtualenvs/cerebrom-5qiep0Vx/local/lib/python2.7/site-packages/compose/cli/main.py", line 956, in up
start=not no_start
File "/home/wayne/.virtualenvs/cerebrom-5qiep0Vx/local/lib/python2.7/site-packages/compose/project.py", line 479, in up
get_deps,
File "/home/wayne/.virtualenvs/cerebrom-5qiep0Vx/local/lib/python2.7/site-packages/compose/parallel.py", line 80, in parallel_execute
raise error_to_reraise
docker.errors.InvalidVersion: mounts param is not supported in API versions < 1.30

# Fixed code
def _get_container_create_options(
    self, override_options, number, one_off=False, previous_container=None
):
    add_config_hash = not one_off and not override_options

    container_options = dict(
        (k, self.options[k]) for k in DOCKER_CONFIG_KEYS if k in self.options
    )
    override_volumes = override_options.pop("volumes", [])
    container_options.update(override_options)

    if not container_options.get("name"):
        container_options["name"] = self.get_container_name(self.name, number, one_off)

    container_options.setdefault("detach", True)

    # If a qualified hostname was given, split it into an
    # unqualified hostname and a domainname unless domainname
    # was also given explicitly. This matches behavior
    # until Docker Engine 1.11.0 - Docker API 1.23.
    if (
        version_lt(self.client.api_version, "1.23")
        and "hostname" in container_options
        and "domainname" not in container_options
        and "." in container_options["hostname"]
    ):
        parts = container_options["hostname"].partition(".")
        container_options["hostname"] = parts[0]
        container_options["domainname"] = parts[2]

    if (
        version_gte(self.client.api_version, "1.25")
        and "stop_grace_period" in self.options
    ):
        container_options["stop_timeout"] = self.stop_timeout(None)

    if "ports" in container_options or "expose" in self.options:
        container_options["ports"] = build_container_ports(
            formatted_ports(container_options.get("ports", [])), self.options
        )

    if "volumes" in container_options or override_volumes:
        container_options["volumes"] = list(
            set(container_options.get("volumes", []) + override_volumes)
        )

    container_options["environment"] = merge_environment(
        self.options.get("environment"), override_options.get("environment")
    )

    container_options["labels"] = merge_labels(
        self.options.get("labels"), override_options.get("labels")
    )

    container_options, override_options = self._build_container_volume_options(
        previous_container, container_options, override_options
    )

    container_options["image"] = self.image_name

    container_options["labels"] = build_container_labels(
        container_options.get("labels", {}),
        self.labels(one_off=one_off),
        number,
        self.config_hash if add_config_hash else None,
    )

    # Delete options which are only used in HostConfig
    for key in HOST_CONFIG_KEYS:
        container_options.pop(key, None)

    container_options["host_config"] = self._get_container_host_config(
        override_options, one_off=one_off
    )

    networking_config = self.build_default_networking_config()
    if networking_config:
        container_options["networking_config"] = networking_config

    container_options["environment"] = format_environment(
        container_options["environment"]
    )
    return container_options