Package com.nirima.docker.client

Examples of com.nirima.docker.client.DockerClient.container()


    @Override
    public void execute(AbstractBuild<?, ?> build) throws DockerException {
        LOGGER.info("Stopping container " + containerId);
        DockerClient client = getClient(build);
        client.container(containerId).stop();
        getLaunchAction(build).stopped(client, containerId);
        if( remove )
            client.container(containerId).remove();
    }
View Full Code Here


        LOGGER.info("Stopping container " + containerId);
        DockerClient client = getClient(build);
        client.container(containerId).stop();
        getLaunchAction(build).stopped(client, containerId);
        if( remove )
            client.container(containerId).remove();
    }


    @Extension
    public static final class DescriptorImpl extends DockerBuilderControlOptionDescriptor {
View Full Code Here

        String containerId = template.provisionNew().getId();

        LOGGER.info("Starting container " + containerId);
        DockerClient client = getClient(build);
        client.container(containerId).start();
        getLaunchAction(build).started(client, containerId);
    }

    @Extension
    public static final class DescriptorImpl extends DockerBuilderControlOptionDescriptor {
View Full Code Here

    @Override
    public void execute(AbstractBuild<?, ?> build) throws DockerException {

        LOGGER.info("Starting container " + containerId);
        DockerClient client = getClient(build);
        client.container(containerId).start();
        getLaunchAction(build).started(client, containerId);

    }

    @Extension
View Full Code Here

    }

    public boolean containerExistsInCloud() {
        try {
            DockerClient client = getClient();
            client.container(containerId).inspect();
            return true;
        } catch(Exception ex) {
            return false;
        }
    }
View Full Code Here

        try {
            toComputer().disconnect(null);

            try {
                DockerClient client = getClient();
                client.container(containerId).stop();
            } catch(Exception ex) {
                LOGGER.log(Level.SEVERE, "Failed to stop instance " + containerId + " for slave " + name + " due to exception", ex);
            }

            // If the run was OK, then do any tagging here
View Full Code Here

                }
            }

            try {
                DockerClient client = getClient();
                client.container(containerId).remove();
            } catch(Exception ex) {
                LOGGER.log(Level.SEVERE, "Failed to remove instance " + containerId + " for slave " + name + " due to exception",ex);
            }

        } catch (Exception e) {
View Full Code Here

        DockerClient client = getClient();


         // Commit
        String tag_image = client.container(containerId).createCommitCommand()
                    .repo(theRun.getParent().getDisplayName())
                    .tag(theRun.getDisplayName())
                    .author("Jenkins")
                    .execute();
View Full Code Here

        final ImageInspectResponse ir = dockerClient.image(ami).inspect();

        Collection<Container> matching = Collections2.filter(containers, new Predicate<Container>() {
            public boolean apply(@Nullable Container container) {
                ContainerInspectResponse cis = dockerClient.container(container.getId()).inspect();
                return (cis.getImage().equalsIgnoreCase(ir.getId()));
            }
        });
        return matching.size();
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.