this.container.withNetworkAliases(name); this.container.waitingFor(waitStrategy()); this.container.withLogConsumer(logConsumer());
this.container.withNetworkAliases(name); this.container.waitingFor(waitStrategy()); this.container.withLogConsumer(logConsumer());
this.container.withNetworkAliases(name); this.container.waitingFor(waitStrategy()); this.container.withLogConsumer(logConsumer());
@Bean(name = ZOOKEEPER_BEAN_NAME, destroyMethod = "stop") public GenericContainer zookeeper(ZookeeperStatusCheck zookeeperStatusCheck, ZookeeperConfigurationProperties zookeeperProperties, ConfigurableEnvironment environment, Network network) { String currentTimestamp = LocalDateTime.now().format(DateTimeFormatter.ofPattern("HH-mm-ss-nnnnnnnnn")); String zkData = Paths.get(zookeeperProperties.getDataFileSystemBind(), currentTimestamp).toAbsolutePath().toString(); log.info("Writing zookeeper data to: {}", zkData); String zkTransactionLogs = Paths.get(zookeeperProperties.getTxnLogsFileSystemBind(), currentTimestamp).toAbsolutePath().toString(); log.info("Writing zookeeper transaction logs to: {}", zkTransactionLogs); log.info("Starting zookeeper server. Docker image: {}", zookeeperProperties.getDockerImage()); int mappingPort = zookeeperProperties.getZookeeperPort(); GenericContainer zookeeper = new FixedHostPortGenericContainer<>(zookeeperProperties.getDockerImage()) .withLogConsumer(containerLogsConsumer(log)) .withEnv("ZOOKEEPER_CLIENT_PORT", String.valueOf(mappingPort)) .withFileSystemBind(zkData, "/var/lib/zookeeper/data", BindMode.READ_WRITE) .withFileSystemBind(zkTransactionLogs, "/var/lib/zookeeper/log", BindMode.READ_WRITE) .withExposedPorts(mappingPort) .withFixedExposedPort(mappingPort, mappingPort) .withNetwork(network) .withNetworkAliases(ZOOKEEPER_HOST_NAME) .waitingFor(zookeeperStatusCheck) .withStartupTimeout(zookeeperProperties.getTimeoutDuration()); zookeeper.start(); registerZookeeperEnvironment(zookeeper, environment, zookeeperProperties); return zookeeper; }
this.container.withNetworkAliases(name); this.container.waitingFor(waitStrategy()); this.container.withLogConsumer(logConsumer());
.withLogConsumer(containerLogsConsumer(log)) .withCreateContainerCmdModifier(cmd -> cmd.withHostName(KAFKA_HOST_NAME)) .withEnv("KAFKA_ZOOKEEPER_CONNECT", containerZookeeperConnect)
protected static GenericContainer create(CouchbaseProperties properties, Logger containerLogger, Network network) { return new FixedHostPortGenericContainer<>(properties.dockerImage) .withFixedExposedPort(properties.carrierDirectPort, properties.carrierDirectPort) .withFixedExposedPort(properties.httpDirectPort, properties.httpDirectPort) .withFixedExposedPort(properties.queryServicePort, properties.queryServicePort) .withFixedExposedPort(properties.queryRestTrafficPort, properties.queryRestTrafficPort) .withFixedExposedPort(properties.searchServicePort, properties.searchServicePort) .withFixedExposedPort(properties.analyticsServicePort, properties.analyticsServicePort) .withFixedExposedPort(properties.memcachedSslPort, properties.memcachedSslPort) .withFixedExposedPort(properties.memcachedPort, properties.memcachedPort) .withFixedExposedPort(properties.queryRestTrafficSslPort, properties.queryRestTrafficSslPort) .withFixedExposedPort(properties.queryServiceSslPort, properties.queryServiceSslPort) .withLogConsumer(containerLogsConsumer(containerLogger)) .withNetwork(network) .withNetworkAliases(COUCHBASE_HOST_NAME) .waitingFor(getCompositeWaitStrategy(properties)) .withStartupTimeout(properties.getTimeoutDuration()); }