entityStrategies = ImmutableList.of();
}
// Use the docker strategy to add a new host
DockerHostLocation machine = null;
DockerHost dockerHost = null;
if (available.size() > 0) {
machine = available.get(0);
dockerHost = machine.getOwner();
} else {
Iterable<DockerAwareProvisioningStrategy> provisioningStrategies = Iterables.filter(Iterables.concat(strategies, entityStrategies), DockerAwareProvisioningStrategy.class);
for (DockerAwareProvisioningStrategy strategy : provisioningStrategies) {
flags = strategy.apply((Map<String,Object>) flags);
}
LOG.info("Provisioning new host with flags: {}", flags);
SshMachineLocation provisioned = getProvisioner().obtain(flags);
Entity added = getDockerInfrastructure().getDockerHostCluster().addNode(provisioned, MutableMap.of());
dockerHost = (DockerHost) added;
machine = dockerHost.getDynamicLocation();
}
// Now wait until the host has started up
Entities.waitForServiceUp(dockerHost);