use of com.github.qzagarese.dockerunit.annotation.ContainerBuilder in project dockerunit by qzagarese.
the class ConsulDescriptor method setup.
@ContainerBuilder
public CreateContainerCmd setup(CreateContainerCmd cmd) {
List<ExposedPort> ports = new ArrayList<>(Arrays.asList(cmd.getExposedPorts()));
ExposedPort dnsPort = ExposedPort.udp(CONSUL_DNS_PORT);
ports.add(dnsPort);
ExposedPort consulPort = ExposedPort.tcp(CONSUL_PORT);
ports.add(consulPort);
Ports bindings = cmd.getPortBindings();
if (bindings == null) {
bindings = new Ports();
}
bindings.bind(dnsPort, Binding.bindPort(8600));
bindings.bind(consulPort, Binding.bindPort(8500));
return cmd.withExposedPorts(ports).withPortBindings(bindings).withCmd("agent", "-dev", "-client=0.0.0.0", "-enable-script-checks");
}
Aggregations