File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
docker/docker/src/main/java/org/arquillian/cube/docker/impl/await Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -111,7 +111,7 @@ public boolean await() {
111111 } catch (UnsupportedOperationException e ) {
112112 // In case of not having ss command installed on container, it automatically fall back to waitforit approach
113113 try {
114- if (!executeWaitForIt (portBindings . getInternalIP ( ), port )) {
114+ if (!executeWaitForIt (getReadyCheckIp ( portBindings ), port )) {
115115 return false ;
116116 }
117117 } catch (UnsupportedOperationException ex ) {
@@ -132,7 +132,7 @@ public boolean await() {
132132 }
133133 break ;
134134 case "waitforit" : {
135- if (!executeWaitForIt (portBindings . getInternalIP ( ), port )) {
135+ if (!executeWaitForIt (getReadyCheckIp ( portBindings ), port )) {
136136 return false ;
137137 }
138138 }
@@ -142,6 +142,17 @@ public boolean await() {
142142 return true ;
143143 }
144144
145+ private String getReadyCheckIp (HasPortBindings portBindings ) {
146+ String ip = portBindings .getInternalIP ();
147+ if (ip == null || "" .equals (ip )) {
148+ ip = portBindings .getContainerIP ();
149+ }
150+ if (ip == null || "" .equals (ip )) {
151+ ip = "localhost" ;
152+ }
153+ return ip ;
154+ }
155+
145156 private boolean executeWaitForIt (String containerIp , int port ) {
146157
147158 // We copy our wait-for-it-sh.sh file form classpath
You can’t perform that action at this time.
0 commit comments