Package com.spotify.docker.client.messages

Examples of com.spotify.docker.client.messages.ContainerConfig


    if (imageInfo == null) {
      throw new HeliosRuntimeException("docker inspect image returned null on image " + image);
    }

    // Create container
    final ContainerConfig containerConfig = config.containerConfig(imageInfo);
    final String name = config.containerName();
    listener.creating();
    final ContainerCreation container = docker.createContainer(containerConfig, name);
    log.info("created container: {}: {}, {}", config, container, containerConfig);
    listener.created(container.id());
View Full Code Here


        client, testHost(), jobId, RUNNING, LONG_WAIT_SECONDS, SECONDS);
    assertJobEquals(job, taskStatus.getJob());

    try (final DockerClient docker = getNewDockerClient()) {

      final ContainerConfig containerConfig =
          docker.inspectContainer(taskStatus.getContainerId()).config();

      assertEquals(MEMORY, containerConfig.memory());
      assertEquals(MEMORY_SWAP, containerConfig.memorySwap());
      assertEquals(CPU_SHARES, containerConfig.cpuShares());
      assertEquals(CPUSET, containerConfig.cpuset());
    }
  }
View Full Code Here

  }

  @Override
  public void decorateContainerConfig(Job job, ImageInfo imageInfo,
                                      ContainerConfig.Builder containerConfig) {
    ContainerConfig imageConfig = imageInfo.containerConfig();

    final List<String> entrypoint = Lists.newArrayList("/helios/syslog-redirector",
                                                       "-h", syslogHostPort,
                                                       "-n", job.getId().toString(),
                                                       "--");
    if (imageConfig.entrypoint() != null) {
      entrypoint.addAll(imageConfig.entrypoint());
    }
    containerConfig.entrypoint(entrypoint);

    final Set<String> volumes = Sets.newHashSet();
    if (containerConfig.volumes() != null) {
View Full Code Here

  }

  private void startContainer(final String name)
      throws DockerException, InterruptedException {
    docker.pull(BUSYBOX);
    final ContainerConfig config = ContainerConfig.builder()
        .image(BUSYBOX)
        .cmd(IDLE_COMMAND)
        .build();
    final HostConfig hostConfig = HostConfig.builder().build();
    final ContainerCreation creation = docker.createContainer(config, name);
View Full Code Here

        docker.inspectImage(BUSYBOX);
      } catch (ImageNotFoundException e) {
        docker.pull(BUSYBOX);
      }

      final ContainerConfig config = ContainerConfig.builder()
          .image(BUSYBOX)
          .cmd("nc", "-p", "4711", "-lle", "cat")
          .exposedPorts(ImmutableSet.of("4711/tcp"))
          .build();
      final HostConfig hostConfig = HostConfig.builder()
View Full Code Here

                                                       .setContainerId(null)
                                                       .setEnv(ENV)
                                                       .build())
    );
    createFuture.set(createResponse);
    final ContainerConfig containerConfig = containerConfigCaptor.getValue();
    assertEquals(IMAGE, containerConfig.image());
    assertEquals(EXPECTED_CONTAINER_ENV, ImmutableSet.copyOf(containerConfig.env()));
    final String containerName = containerNameCaptor.getValue();

    assertEquals(JOB.getId().toShortString(), shortJobIdFromContainerName(containerName));

    // Verify that the container is started
View Full Code Here

                                                       .setContainerId(null)
                                                       .setEnv(ENV)
                                                       .build())
    );
    createFuture.set(createResponse);
    final ContainerConfig containerConfig = containerConfigCaptor.getValue();
    assertEquals(IMAGE, containerConfig.image());
    assertEquals(EXPECTED_CONTAINER_ENV, ImmutableSet.copyOf(containerConfig.env()));
    final String containerName = containerNameCaptor.getValue();

    assertEquals(JOB.getId().toShortString(), shortJobIdFromContainerName(containerName));

    // Verify that the container is started
View Full Code Here

TOP

Related Classes of com.spotify.docker.client.messages.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.