title: How to wait for an open port with netcat?
body: <p>I'm trying to do a custom dockerfile with jenkins on it. I would to wait until port 8080 is open instead of doing an ugly 'sleep 60' with netcat but I'm not very confident with bash scripts and netcat.</p>
  <p>Here is an example of what i'm trying to do:</p>
  <pre><code>#!/bin/bash
   
  opened=0
   
  while [ &quot;$opened&quot;  == &quot;0&quot; ]; do
    echo &quot;Waiting jenkins to launch on 8080...&quot;
    nc -vz localhost 8080
  done
   
  echo &quot;Jenkins launched&quot;
  </code></pre>