@Test public void startContainer() throws Exception { String parentId = manager.startContainer(busyboxImageName, Constants.CONTAINER_TYPE_SYSTEM, null, sleepCommand); assertNotNull(parentId); services.add(parentId); String containerId = manager.startContainer(busyboxImageName, Constants.CONTAINER_TYPE_SYSTEM, parentId, sleepCommand); assertNotNull(containerId); services.add(containerId); final Service serviceInfo = dockerClient.inspectService(containerId); assertNotNull("Service inspection response from docker", serviceInfo); assertThat("Container ID as seen by the platform (names are used in place of IDs)", containerId, not(equalTo(serviceInfo.id()))); assertEquals("Type label of created swarm service", serviceInfo.spec().labels().get(ContainerManagerImpl.LABEL_TYPE), Constants.CONTAINER_TYPE_SYSTEM); assertEquals("Parent label of created swarm service", parentId, serviceInfo.spec().labels().get(ContainerManagerImpl.LABEL_PARENT)); List<Task> tasks = dockerClient.listTasks(Task.Criteria.builder().serviceName(containerId).build()); assertEquals("Amount of tasks of created swarm service", 1, tasks.size()); for (Task taskInfo : tasks) { assertEquals("Task state of created swarm service", TaskStatus.TASK_STATE_RUNNING, taskInfo.status().state()); assertTrue("Command of created container spec is sleepCommand", Arrays.equals(sleepCommand, taskInfo.spec().containerSpec().command().toArray())); } }
@Deprecated public String startContainer(String imageName) { return startContainer(imageName, null, "", null); }
ContainerManagerImpl implements ContainerManager { @Deprecated public String startContainer(String imageName) { return startContainer(imageName, null, "", null); } }
ContainerManagerImpl implements ContainerManager { @Deprecated public String startContainer(String imageName) { return startContainer(imageName, null, "", null); } ContainerManagerImpl(); }
ContainerManagerImpl implements ContainerManager { @Deprecated public String startContainer(String imageName) { return startContainer(imageName, null, "", null); } ContainerManagerImpl(); void pullImage(String imageName); @Deprecated String startContainer(String imageName); @Deprecated String startContainer(String imageName, String[] command); String startContainer(String imageName, String type, String parent); @Override String startContainer(String imageName, String containerType, String parentId, String[] command); @Override String startContainer(String imageName, String containerType, String parentId, String[] env,
            String[] command); @Override String startContainer(String imageName, String containerType, String parentId, String[] env,
    String[] netAliases, String[] command); @Override String startContainer(String imageName, String containerType, String parentId, String[] env,
            String[] command, boolean pullImage); @Override String startContainer(String imageName, String containerType, String parentId, String[] env,
            String[] netAliases, String[] command, boolean pullImage); @Override String startContainer(String imageName, String containerType, String parentId, String[] env,
            String[] netAliases, String[] command, String experimentId); @Override void removeContainer(String serviceName); @Deprecated @Override void stopContainer(String containerId); @Deprecated @Override void stopParentAndChildren(String parentId); @Override void removeParentAndChildren(String parent); @Override Service getContainerInfo(String serviceName); @Override List<Service> getContainers(Service.Criteria criteria); @Override Integer getContainerExitCode(String serviceName); @Deprecated @Override String getContainerId(String name); @Deprecated @Override String getContainerName(String containerId); @Override void addContainerObserver(ContainerStateObserver containerObserver); static boolean containsVersionTag(String imageName); @Override ContainerStats getStats(String containerId); }
ContainerManagerImpl implements ContainerManager { @Deprecated public String startContainer(String imageName) { return startContainer(imageName, null, "", null); } ContainerManagerImpl(); void pullImage(String imageName); @Deprecated String startContainer(String imageName); @Deprecated String startContainer(String imageName, String[] command); String startContainer(String imageName, String type, String parent); @Override String startContainer(String imageName, String containerType, String parentId, String[] command); @Override String startContainer(String imageName, String containerType, String parentId, String[] env,
            String[] command); @Override String startContainer(String imageName, String containerType, String parentId, String[] env,
    String[] netAliases, String[] command); @Override String startContainer(String imageName, String containerType, String parentId, String[] env,
            String[] command, boolean pullImage); @Override String startContainer(String imageName, String containerType, String parentId, String[] env,
            String[] netAliases, String[] command, boolean pullImage); @Override String startContainer(String imageName, String containerType, String parentId, String[] env,
            String[] netAliases, String[] command, String experimentId); @Override void removeContainer(String serviceName); @Deprecated @Override void stopContainer(String containerId); @Deprecated @Override void stopParentAndChildren(String parentId); @Override void removeParentAndChildren(String parent); @Override Service getContainerInfo(String serviceName); @Override List<Service> getContainers(Service.Criteria criteria); @Override Integer getContainerExitCode(String serviceName); @Deprecated @Override String getContainerId(String name); @Deprecated @Override String getContainerName(String containerId); @Override void addContainerObserver(ContainerStateObserver containerObserver); static boolean containsVersionTag(String imageName); @Override ContainerStats getStats(String containerId); static final String DEPLOY_ENV_KEY; static final String DOCKER_AUTOPULL_ENV_KEY; static final String LOGGING_GELF_ADDRESS_KEY; static final String USER_NAME_KEY; static final String USER_EMAIL_KEY; static final String USER_PASSWORD_KEY; static final String REGISTRY_URL_KEY; static final String HOBBIT_DOCKER_NETWORK; static final String LOGGING_TAG; static final Set<String> NEW_TASKS_STATES; static final Set<String> UNFINISHED_TASK_STATES; }