public static HostConfig newHostConfig() { return new HostConfig(); }
/** * Set any custom settings for the create command such as shared memory size. */ private HostConfig buildHostConfig() { HostConfig config = new HostConfig(); if (shmSize != null) { config.withShmSize(shmSize); } if (tmpFsMapping != null) { config.withTmpFs(tmpFsMapping); } return config; }
public static HostConfig newHostConfig() { return new HostConfig(); }
/** * Set any custom settings for the create command such as shared memory size. */ private HostConfig buildHostConfig() { HostConfig config = new HostConfig(); if (shmSize != null) { config.withShmSize(shmSize); } if (tmpFsMapping != null) { config.withTmpFs(tmpFsMapping); } return config; }
/** * Builds {@link HostConfig} * <p> * There is normally no need to overwrite this method!<br> * If you need to overwrite this method, make sure that all ports are published (necessary for mac)! * * @return configured {@link HostConfig} */ protected HostConfig buildHostConfig() { HostConfig hostConfig = new HostConfig(); hostConfig.withPublishAllPorts(Boolean.TRUE); if (!getTmpDirectories().isEmpty() && OSUtils.isLinux()) { Map<String, String> tmpDirectories = new HashMap<>(); getTmpDirectories().forEach(directory -> tmpDirectories.put(directory, "")); hostConfig.withTmpFs(tmpDirectories); } return hostConfig; }
List<Bind> binds = new ArrayList<>(); binds.add(new Bind("//var/run/docker.sock", new Volume("/var/run/docker.sock"))); String ryukContainerId = client.createContainerCmd(ryukImage).withHostConfig(new HostConfig().withAutoRemove(true)).withExposedPorts(new ExposedPort(8080)).withPublishAllPorts(true).withName("testcontainers-ryuk-" + DockerClientFactory.SESSION_ID).withLabels(Collections.singletonMap(DockerClientFactory.TESTCONTAINERS_LABEL, "true")).withBinds(binds).withPrivileged(TestcontainersConfiguration.getInstance().isRyukPrivileged()).exec().getId(); client.startContainerCmd(ryukContainerId).exec(); InspectContainerResponse inspectedContainer = client.inspectContainerCmd(ryukContainerId).exec();
private CreateContainerCmd createCreateContainerCmd() { List<Bind> volumeBinds = volumeBindSpecs.stream().map(Bind::parse).collect(Collectors.toList()); final HostConfig hostConfig = new HostConfig();
@Before public void setup() { HostConfig hostConfig = new HostConfig(); hostConfig.withPortBindings(new Ports()); when(inspectContainerResponse.getHostConfig()).thenReturn(hostConfig); when(inspectContainerCmd.exec()).thenReturn(inspectContainerResponse); when(dockerClient.inspectContainerCmd(anyString())).thenReturn(inspectContainerCmd); when(executor.getDockerClient()).thenReturn(dockerClient); CubeContainer cubeContainer = new CubeContainer(); cubeContainer.setRemoveVolumes(false); cube = injectorInst.get().inject(new DockerCube(ID, cubeContainer, executor)); }
HostConfig hostConfig = new HostConfig() .withCpuPeriod(this.containerCpuPeriod) .withCpuQuota(this.containerCpuQuota)
HostConfig hc = new HostConfig(); cfgCmd.withLinks(LinkUtils.parseLinks(linksRes).getLinks()); if (envVarsRes != null) {