Skip to content

Commit edd90c3

Browse files
author
Marcus Linke
committed
netty: Test binds in inspect container response
1 parent d3c7df8 commit edd90c3

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

src/test/java/com/github/dockerjava/netty/exec/CreateContainerCmdExecTest.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,18 +142,20 @@ public void createContainerWithVolumesFrom() throws DockerException {
142142

143143
String container1Name = UUID.randomUUID().toString();
144144

145+
Bind bind1 = new Bind("/src/webapp1", volume1);
146+
Bind bind2 = new Bind("/src/webapp2", volume2);
147+
145148
// create a running container with bind mounts
146149
CreateContainerResponse container1 = dockerClient.createContainerCmd("busybox").withCmd("sleep", "9999")
147150
.withName(container1Name)
148-
.withBinds(new Bind("/src/webapp1", volume1), new Bind("/src/webapp2", volume2)).exec();
151+
.withBinds(bind1, bind2).exec();
149152
LOG.info("Created container1 {}", container1.toString());
150153

151-
dockerClient.startContainerCmd(container1.getId()).exec();
152-
LOG.info("Started container1 {}", container1.toString());
153-
154154
InspectContainerResponse inspectContainerResponse1 = dockerClient.inspectContainerCmd(container1.getId())
155155
.exec();
156156

157+
assertThat(Arrays.asList(inspectContainerResponse1.getHostConfig().getBinds()), containsInAnyOrder(bind1, bind2));
158+
157159
assertThat(inspectContainerResponse1, mountedVolumes(containsInAnyOrder(volume1, volume2)));
158160

159161
// create a second container with volumes from first container

0 commit comments

Comments
 (0)