private void applyConfiguration(CreateContainerCmd createCommand) {
        this.containerDef.applyTo(createCommand);
        buildHostConfig(createCommand.getHostConfig());

        VolumesFrom[] volumesFromsArray = volumesFroms.stream().toArray(VolumesFrom[]::new);
        createCommand.withVolumesFrom(volumesFromsArray);

        Set<Link> allLinks = new HashSet<>();
        Set<String> allLinkedContainerNetworks = new HashSet<>();
        for (Entry<String, LinkableContainer> linkEntries : linkedContainers.entrySet()) {
            String alias = linkEntries.getKey();
            LinkableContainer linkableContainer = linkEntries.getValue();

            Set<Link> links = findLinksFromThisContainer(alias, linkableContainer);
            allLinks.addAll(links);

            if (allLinks.size() == 0) {
                throw new ContainerLaunchException(
                    "Aborting attempt to link to container " +
                    linkableContainer.getContainerName() +
                    " as it is not running"
                );
            }

            Set<String> linkedContainerNetworks = findAllNetworksForLinkedContainers(linkableContainer);
            allLinkedContainerNetworks.addAll(linkedContainerNetworks);
        }

        createCommand.withLinks(allLinks.toArray(new Link[allLinks.size()]));

        allLinkedContainerNetworks.remove("bridge");
        if (allLinkedContainerNetworks.size() > 1) {
            logger()
                .warn(
                    "Container needs to be on more than one custom network to link to other " +
                    "containers - this is not currently supported. Required networks are: {}",
                    allLinkedContainerNetworks
                );
        }

        Optional<String> networkForLinks = allLinkedContainerNetworks.stream().findFirst();
        if (networkForLinks.isPresent()) {
            logger().debug("Associating container with network: {}", networkForLinks.get());
            createCommand.withNetworkMode(networkForLinks.get());
        }

        if (hostAccessible) {
            PortForwardingContainer.INSTANCE.start();
        }
        PortForwardingContainer.INSTANCE
            .getNetwork()
            .ifPresent(it -> {
                withExtraHost(INTERNAL_HOST_HOSTNAME, it.getIpAddress());
            });

        String[] extraHostsArray = extraHosts.stream().distinct().toArray(String[]::new);
        createCommand.withExtraHosts(extraHostsArray);

        if (workingDirectory != null) {
            createCommand.withWorkingDir(workingDirectory);
        }

        for (CreateContainerCmdModifier createContainerCmdModifier : this.createContainerCmdModifiers) {
            createCommand = createContainerCmdModifier.modify(createCommand);
        }
    }
@return the ports on which to check if the container is ready
@deprecated use {@link #getLivenessCheckPortNumbers()} instead
core/src/main/java/org/testcontainers/containers/GenericContainer.java