CreateContainerCmd.withLabels
Code IndexAdd Codota to your IDE (free)

Best code snippets using com.github.dockerjava.api.command.CreateContainerCmd.withLabels(Showing top 11 results out of 315)

origin: testcontainers/testcontainers-java

private <T> T runInsideDocker(DockerClient client, Consumer<CreateContainerCmd> createContainerCmdConsumer, BiFunction<DockerClient, String, T> block) {
  checkAndPullImage(client, TINY_IMAGE);
  CreateContainerCmd createContainerCmd = client.createContainerCmd(TINY_IMAGE)
      .withLabels(DEFAULT_LABELS);
  createContainerCmdConsumer.accept(createContainerCmd);
  String id = createContainerCmd.exec().getId();
  try {
    client.startContainerCmd(id).exec();
    return block.apply(client, id);
  } finally {
    try {
      client.removeContainerCmd(id).withRemoveVolumes(true).withForce(true).exec();
    } catch (NotFoundException | InternalServerErrorException ignored) {
      log.debug("", ignored);
    }
  }
}
origin: vert-x3/vertx-service-discovery

@Test
public void testWithAContainerWithLabels() throws InterruptedException {
 Map<String, String> labels = new LinkedHashMap<>();
 labels.put("service.type", "http-endpoint");
 labels.put("ssl", "true");
 CreateContainerResponse container = client.createContainerCmd("nginx")
   .withExposedPorts(ExposedPort.tcp(80), ExposedPort.tcp(443))
   .withPortBindings(PortBinding.parse("80"))
   .withLabels(labels)
   .exec();
 AtomicBoolean done = new AtomicBoolean();
 Future<Void> future = Future.future();
 future.setHandler(ar -> done.set(ar.succeeded()));
 bridge.scan(future);
 await().untilAtomic(done, is(true));
 assertThat(bridge.getServices()).hasSize(0);
 done.set(false);
 client.startContainerCmd(container.getId()).exec();
 Future<Void> future2 = Future.future();
 future2.setHandler(ar -> done.set(ar.succeeded()));
 bridge.scan(future2);
 await().untilAtomic(done, is(true));
 assertThat(bridge.getServices()).hasSize(1);
 DockerService service = bridge.getServices().get(0);
 assertThat(service.records()).hasSize(1);
 assertThat(service.records().get(0).getLocation().getString("endpoint")).startsWith("https");
}
origin: testcontainers/testcontainers-java

labels = new HashMap<>(labels != null ? labels : Collections.emptyMap());
labels.putAll(DockerClientFactory.DEFAULT_LABELS);
createCommand.withLabels(labels);
origin: jenkinsci/docker-plugin

containerConfig.withLabels(map);
origin: org.arquillian.cube/arquillian-cube-docker

createContainerCmd.withLabels(containerConfiguration.getLabels());
origin: org.testcontainers/testcontainers

private <T> T runInsideDocker(DockerClient client, Consumer<CreateContainerCmd> createContainerCmdConsumer, BiFunction<DockerClient, String, T> block) {
  checkAndPullImage(client, TINY_IMAGE);
  CreateContainerCmd createContainerCmd = client.createContainerCmd(TINY_IMAGE)
      .withLabels(DEFAULT_LABELS);
  createContainerCmdConsumer.accept(createContainerCmd);
  String id = createContainerCmd.exec().getId();
  try {
    client.startContainerCmd(id).exec();
    return block.apply(client, id);
  } finally {
    try {
      client.removeContainerCmd(id).withRemoveVolumes(true).withForce(true).exec();
    } catch (NotFoundException | InternalServerErrorException ignored) {
      log.debug("", ignored);
    }
  }
}
origin: org.testcontainers/testcontainers

labels = new HashMap<>(labels != null ? labels : Collections.emptyMap());
labels.putAll(DockerClientFactory.DEFAULT_LABELS);
createCommand.withLabels(labels);
origin: org.arquillian.cube/arquillian-cube-docker

createContainerCmd.withLabels(containerConfiguration.getLabels());
origin: org.arquillian.cube/arquillian-cube-docker

createContainerCmd.withLabels(containerConfiguration.getLabels());
origin: arquillian/arquillian-cube

createContainerCmd.withLabels(containerConfiguration.getLabels());
origin: org.arquillian.cube/arquillian-cube-docker

createContainerCmd.withLabels(containerConfiguration.getLabels());
com.github.dockerjava.api.commandCreateContainerCmdwithLabels

Popular methods of CreateContainerCmd

  • exec
  • withCmd
  • withExposedPorts
  • withName
  • withBinds
  • withEnv
  • withPortBindings
    Add one or more PortBindings. This corresponds to the --publish (-p) option of thedocker run CLI com
  • withPublishAllPorts
  • withExtraHosts
    Add hostnames to /etc/hosts in the container
  • withMemory
  • withNetworkMode
    Set the Network mode for the container * 'bridge': creates a new network stack for the container
  • withPrivileged
  • withNetworkMode,
  • withPrivileged,
  • withCpuShares,
  • withDns,
  • withHostName,
  • withLinks,
  • withTty,
  • withVolumesFrom,
  • withWorkingDir

Popular classes and methods

  • startActivity (Activity)
  • getApplicationContext (Context)
  • setRequestProperty (URLConnection)
    Sets the value of the specified request header field. The value will only be used by the current URL
  • Point (java.awt)
    A point representing a location in (x,y) coordinate space, specified in integer precision.
  • Kernel (java.awt.image)
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement.A servlet is a small Java program that runs within

For IntelliJ IDEA and
Android Studio

  • Codota IntelliJ IDEA pluginCodota Android Studio pluginCode IndexSign in
  • EnterpriseFAQAboutContact Us
  • Terms of usePrivacy policyCodeboxFind Usages
Add Codota to your IDE (free)