use of io.fabric8.maven.docker.access.DockerMachine in project docker-maven-plugin by fabric8io.
the class DockerAccessFactory method getDefaultDockerHostProviders.
/**
* Return a list of providers which could delive connection parameters from
* calling external commands. For this plugin this is docker-machine, but can be overridden
* to add other config options, too.
*
* @return list of providers or <code>null</code> if none are applicable
*/
private List<DockerConnectionDetector.DockerHostProvider> getDefaultDockerHostProviders(DockerAccessContext dockerAccessContext, Logger log) {
DockerMachineConfiguration config = dockerAccessContext.getMachine();
if (dockerAccessContext.isSkipMachine()) {
config = null;
} else if (config == null) {
Properties projectProps = dockerAccessContext.getProjectProperties();
if (projectProps.containsKey(DockerMachineConfiguration.DOCKER_MACHINE_NAME_PROP)) {
config = new DockerMachineConfiguration(projectProps.getProperty(DockerMachineConfiguration.DOCKER_MACHINE_NAME_PROP), projectProps.getProperty(DockerMachineConfiguration.DOCKER_MACHINE_AUTO_CREATE_PROP));
}
}
List<DockerConnectionDetector.DockerHostProvider> ret = new ArrayList<>();
ret.add(new DockerMachine(log, config));
return ret;
}
use of io.fabric8.maven.docker.access.DockerMachine in project docker-maven-plugin by fabric8io.
the class DockerMachineIT method testLaunchDockerMachine.
@Test
public void testLaunchDockerMachine() throws Exception {
DockerMachineConfiguration mc = new DockerMachineConfiguration("default", "true");
DockerMachine de = new DockerMachine(new AnsiLogger(new SystemStreamLog(), true, true), mc);
Assert.assertTrue(de.getConnectionParameter(null) != null);
}
Aggregations