From cf72d080b0cc5b20c06270695b5266a411b3bf16 Mon Sep 17 00:00:00 2001 From: Sergei Egorov Date: Wed, 13 Jun 2018 22:12:29 +0200 Subject: [PATCH] Read from both `/proc/net/tcp` and `/proc/net/tcp6` in `InternalCommandPortListeningCheck` (#750) --- .../wait/internal/InternalCommandPortListeningCheck.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/java/org/testcontainers/containers/wait/internal/InternalCommandPortListeningCheck.java b/core/src/main/java/org/testcontainers/containers/wait/internal/InternalCommandPortListeningCheck.java index 2cf7092f1ae..a4ba013b9d7 100644 --- a/core/src/main/java/org/testcontainers/containers/wait/internal/InternalCommandPortListeningCheck.java +++ b/core/src/main/java/org/testcontainers/containers/wait/internal/InternalCommandPortListeningCheck.java @@ -30,7 +30,7 @@ public Boolean call() { private void tryPort(Integer internalPort) { String[][] commands = { - {"/bin/sh", "-c", format("cat /proc/net/tcp | awk '{print $2}' | grep -i :%x && echo %s", internalPort, SUCCESS_MARKER)}, + {"/bin/sh", "-c", format("cat /proc/net/tcp{,6} | awk '{print $2}' | grep -i :%x && echo %s", internalPort, SUCCESS_MARKER)}, {"/bin/sh", "-c", format("nc -vz -w 1 localhost %d && echo %s", internalPort, SUCCESS_MARKER)}, {"/bin/bash", "-c", format("