Package com.nirima.docker.client.model

Examples of com.nirima.docker.client.model.ContainerConfig


        return "Image of " + image;
    }

    public ContainerInspectResponse provisionNew(DockerClient dockerClient) throws DockerException {

        ContainerConfig containerConfig = createContainerConfig();

        ContainerCreateResponse container = dockerClient.containers().create(containerConfig);

        // Launch it.. :
View Full Code Here


        return PortMapping.parse(bindPorts);
    }

    public ContainerConfig createContainerConfig() {
        ContainerConfig containerConfig = new ContainerConfig();
        containerConfig.setImage(image);

        if (hostname != null && !hostname.isEmpty()) {
            containerConfig.setHostName(hostname);
        }
        String[] cmd = getDockerCommandArray();
        if( cmd.length > 0)
            containerConfig.setCmd(cmd);
        containerConfig.setPortSpecs(new String[]{"22/tcp"});

        //containerConfig.setPortSpecs(new String[]{"22/tcp"});
        //containerConfig.getExposedPorts().put("22/tcp",new ExposedPort());
        if( dnsHosts.length > 0 )
            containerConfig.setDns(dnsHosts);
        if( volumesFrom != null && !volumesFrom.isEmpty() )
            containerConfig.setVolumesFrom(volumesFrom);

        return containerConfig;
    }
View Full Code Here

TOP

Related Classes of com.nirima.docker.client.model.ContainerConfig

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.