Пример #1
0
 @Override
 public void copyTo(TemplateOptions to) {
   super.copyTo(to);
   if (to instanceof DockerTemplateOptions) {
     DockerTemplateOptions eTo = DockerTemplateOptions.class.cast(to);
     if (!volumes.isEmpty()) {
       eTo.volumes(volumes);
     }
     eTo.hostname(hostname);
     if (!dns.isEmpty()) {
       eTo.dns(dns);
     }
     eTo.memory(memory);
     eTo.cpuShares(cpuShares);
     if (!commands.isEmpty()) {
       eTo.commands(commands);
     }
     if (!env.isEmpty()) {
       eTo.env(env);
     }
     if (!portBindings.isEmpty()) {
       eTo.portBindings(portBindings);
     }
     eTo.networkMode(networkMode);
     if (!extraHosts.isEmpty()) {
       eTo.extraHosts(extraHosts);
     }
   }
 }
  public void testCreateNodeWithGroupEncodedIntoNameThenStoreCredentials() {
    String group = "foo";
    String name = "container" + new Random().nextInt();

    Template template = templateBuilder.imageId(defaultImage.id()).build();

    DockerTemplateOptions options = template.getOptions().as(DockerTemplateOptions.class);
    options.env(ImmutableList.of("ROOT_PASSWORD=password"));
    guest = adapter.createNodeWithGroupEncodedIntoName(group, name, template);
    assertEquals(guest.getNodeId(), guest.getNode().id());
  }
Пример #3
0
 /** @see DockerTemplateOptions#env(Iterable) */
 public static DockerTemplateOptions env(Iterable<String> env) {
   DockerTemplateOptions options = new DockerTemplateOptions();
   return options.env(env);
 }
Пример #4
0
 /** @see DockerTemplateOptions#env(String...) */
 public static DockerTemplateOptions env(String... env) {
   DockerTemplateOptions options = new DockerTemplateOptions();
   return options.env(env);
 }