Skip to content

Commit

Permalink
test compile fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrey Kurilov committed Nov 28, 2018
1 parent d79c7ec commit 25c8e5b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/test/java/com/emc/mongoose/util/docker/ContainerBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import com.github.dockerjava.api.model.Bind;
import com.github.dockerjava.api.model.ExposedPort;
import com.github.dockerjava.api.model.Frame;
import com.github.dockerjava.api.model.HostConfig;
import com.github.dockerjava.api.model.Volume;
import com.github.dockerjava.core.DockerClientBuilder;
import com.github.dockerjava.core.command.PullImageResultCallback;
Expand Down Expand Up @@ -128,9 +129,7 @@ private String createContainer() {
final CreateContainerCmd createContainerCmd = Docker.CLIENT
.createContainerCmd(imageNameWithVer)
.withName(imageName().replace('/', '_') + '_' + this.hashCode())
.withNetworkMode("host")
.withExposedPorts(exposedPorts)
.withMemory(memoryLimit)
.withCmd(args);
if(env != null && !env.isEmpty()) {
createContainerCmd.withEnv(env);
Expand All @@ -140,6 +139,9 @@ private String createContainer() {
.withAttachStdout(attachOutputFlag)
.withAttachStderr(attachOutputFlag);
}
final HostConfig hostConfig = HostConfig.newHostConfig()
.withNetworkMode("host")
.withMemory(memoryLimit);
if(volumeBinds != null && !volumeBinds.isEmpty()) {
final List<Volume> volumes = new ArrayList<>(volumeBinds.size());
final List<Bind> binds = new ArrayList<>(volumeBinds.size());
Expand All @@ -152,8 +154,9 @@ private String createContainer() {
}
);
createContainerCmd.withVolumes(volumes);
createContainerCmd.withBinds(binds);
hostConfig.withBinds(binds);
}
createContainerCmd.withHostConfig(hostConfig);
final String entrypoint = entrypoint();
if(entrypoint != null && !entrypoint.isEmpty()) {
createContainerCmd.withEntrypoint(entrypoint);
Expand Down

0 comments on commit 25c8e5b

Please sign in to comment.