@Override protected void configure() { setStartupAttempts(3); withCreateContainerCmdModifier(cmd -> cmd.withCapAdd(IPC_LOCK)); if(!isVaultPortRequested()){ withEnv("VAULT_ADDR", "http://0.0.0.0:" + VAULT_PORT); } }
@Override protected void configure() { setStartupAttempts(3); withCreateContainerCmdModifier(cmd -> cmd.withCapAdd(IPC_LOCK)); if(!isVaultPortRequested()){ withEnv("VAULT_ADDR", "http://0.0.0.0:" + VAULT_PORT); } }
.withBinds(volumeBinds) .withUlimits(ulimits) .withCapAdd(new ArrayList<>(addCapabilities)) .withCapDrop(new ArrayList<>(dropCapabilities)) .withPrivileged(privileged);
public void startNode(String id, BrowserType browserType, String nodeName, String imageId, boolean record, String containerIp) { // Create node pullImageIfNecessary(imageId, true); log.debug("Creating container for browser '{}'", id); CreateContainerCmd createContainerCmd = getClient().createContainerCmd(imageId).withPrivileged(true).withCapAdd(SYS_ADMIN).withName(nodeName); mountDefaultFolders(createContainerCmd); mountFiles(createContainerCmd); createContainerCmd.withNetworkMode("none"); Map<String, String> labels = new HashMap<>(); labels.put("KurentoDnat", "true"); labels.put("Transport", getProperty(TEST_SELENIUM_TRANSPORT)); labels.put("IpAddress", containerIp); createContainerCmd.withLabels(labels); createContainerCmd.exec(); log.debug("Container {} started...", nodeName); // Start node if stopped startContainer(nodeName); startRecordingIfNeeded(id, nodeName, record); logMounts(nodeName); logNetworks(nodeName); }
public void startNode(String id, BrowserType browserType, String nodeName, String imageId, boolean record, String containerIp) { // Create node pullImageIfNecessary(imageId, true); log.debug("Creating container for browser '{}'", id); CreateContainerCmd createContainerCmd = getClient().createContainerCmd(imageId).withPrivileged(true).withCapAdd(SYS_ADMIN).withName(nodeName); mountDefaultFolders(createContainerCmd); mountFiles(createContainerCmd); createContainerCmd.withNetworkMode("none"); Map<String, String> labels = new HashMap<>(); labels.put("KurentoDnat", "true"); labels.put("Transport", getProperty(TEST_SELENIUM_TRANSPORT)); labels.put("IpAddress", containerIp); createContainerCmd.withLabels(labels); createContainerCmd.exec(); log.debug("Container {} started...", nodeName); // Start node if stopped startContainer(nodeName); startRecordingIfNeeded(id, nodeName, record); logMounts(nodeName); logNetworks(nodeName); }
@Bean(name = AEROSPIKE_BEAN_NAME, destroyMethod = "stop") public GenericContainer aerospike(AerospikeWaitStrategy aerospikeWaitStrategy, ConfigurableEnvironment environment, AerospikeProperties properties) { log.info("Starting aerospike server. Docker image: {}", properties.dockerImage); WaitStrategy waitStrategy = new WaitAllStrategy() .withStrategy(aerospikeWaitStrategy) .withStrategy(new HostPortWaitStrategy()) .withStartupTimeout(Duration.of(60, SECONDS)); GenericContainer aerospike = new GenericContainer<>(properties.dockerImage) .withExposedPorts(properties.port) .withLogConsumer(containerLogsConsumer(log)) // see https://github.com/aerospike/aerospike-server.docker/blob/master/aerospike.template.conf .withEnv("NAMESPACE", properties.namespace) .withEnv("SERVICE_PORT", String.valueOf(properties.port)) .withEnv("MEM_GB", String.valueOf(1)) .withEnv("STORAGE_GB", String.valueOf(1)) .withCreateContainerCmdModifier(cmd -> cmd.withCapAdd(Capability.NET_ADMIN)) .waitingFor(waitStrategy) .withStartupTimeout(properties.getTimeoutDuration()); aerospike.start(); registerAerospikeEnvironment(aerospike, environment, properties); return aerospike; }
public void startNode(String id, BrowserType browserType, String nodeName, String imageId, boolean record) { // Create node pullImageIfNecessary(imageId, true); log.debug("Creating container for browser '{}'", id); CreateContainerCmd createContainerCmd = getClient().createContainerCmd(imageId).withPrivileged(true).withCapAdd(SYS_ADMIN).withName(nodeName); mountDefaultFolders(createContainerCmd); mountFiles(createContainerCmd); if (isRunningInContainer()) { createContainerCmd.withNetworkMode("bridge"); } createContainerCmd.exec(); log.debug("Container {} started...", nodeName); // Start node if stopped startContainer(nodeName); startRecordingIfNeeded(id, nodeName, record); logMounts(nodeName); logNetworks(nodeName); listFolderInContainer(nodeName, KurentoTest.getTestFilesDiskPath()); }
public void startNode(String id, BrowserType browserType, String nodeName, String imageId, boolean record) { // Create node pullImageIfNecessary(imageId, true); log.debug("Creating container for browser '{}'", id); CreateContainerCmd createContainerCmd = getClient().createContainerCmd(imageId).withPrivileged(true).withCapAdd(SYS_ADMIN).withName(nodeName); mountDefaultFolders(createContainerCmd); mountFiles(createContainerCmd); if (isRunningInContainer()) { createContainerCmd.withNetworkMode("bridge"); } createContainerCmd.exec(); log.debug("Container {} started...", nodeName); // Start node if stopped startContainer(nodeName); startRecordingIfNeeded(id, nodeName, record); logMounts(nodeName); logNetworks(nodeName); listFolderInContainer(nodeName, KurentoTest.getTestFilesDiskPath()); }
createContainerCmd.withCapAdd(toCapability(containerConfiguration.getCapAdd()));
createContainerCmd.withCapAdd(toCapability(containerConfiguration.getCapAdd()));
createContainerCmd.withCapAdd(capAdd);