Skip to content

Commit 6e78284

Browse files
committed
Use JSON format for Docker port bindings inspection since go format has changed with "invalid IP"
1 parent 81a266d commit 6e78284

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/main/java/io/ebean/test/containers/Commands.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,11 +208,11 @@ public List<String> ports(String containerName) {
208208
* Check if the port matches the existing port bindings and if not return the existing port bindings.
209209
*/
210210
public String registeredPortMatch(String containerName, int matchPort) {
211-
ProcessResult result = ProcessHandler.command(docker, "container", "inspect", containerName, "--format={{.HostConfig.PortBindings}}");
211+
ProcessResult result = ProcessHandler.command(docker, "container", "inspect", containerName, "--format={{json .HostConfig.PortBindings}}");
212212
List<String> outLines = result.getOutLines();
213213
for (String outLine : outLines) {
214214
if (outLine.startsWith("map")) {
215-
if (outLine.contains("{ " + matchPort + "}")) {
215+
if (outLine.contains("\"HostPort\":\"" + matchPort + "\"}")) {
216216
// port matching all good
217217
return null;
218218
} else {

0 commit comments

Comments
 (0)