-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can you make an /bin/sh version for use with alpine linux ? #18
Comments
I made an POSIX version, which you can find here. |
First off thank you @raphaelahrens that is awesome! second off @vishnubob I understand your desire to keep the dependancies to 0, but nc is included in alpine and with the docker community all moving to alpine I think it would still be valuable? @raphaelahrens when I run your script with no timeout setting I kept getting the error: |
@blacktop could you create an issue on my fork and describe how you call the script and under which OS/distro? |
it looks like it is the same thing that happened here #5 |
also there is no UI in github for issues on forks. |
Pull Requests #17 fixes it for me, but requires I install bash :( |
@blacktop Ah ok I will take a look at it seems like alpine doesn't have timeout either. |
It doesn't work for Alpine Linux. |
Let me share a tool I have written in Go with cross platform support and which has the same purpose of this project (even the name is the same) https://github.com/maxcnunes/waitforit. |
@maxcnunes that is a really nice solution to this problem 👏 |
There is always https://github.com/depop/wait-for-it but it has a reliance on bash shell. It also supports multiple host waits |
@raphaelahrens have you had any trouble with |
@eddieajau no I haven't. Sounds like an address resolution problem. Is the address reachable from the machine/vm? |
@raphaelahrens so the problem is that when our Docker machine is spinning up, some of the containers take time to register their host names. While So the issue is that |
In the meantime wait-for-command can help. It is a Posix sh compliant which receives a command an waits for a specific exit status to finish waiting. It does not depend on a specific command so you could use whatever your distribution has available. In Alpine Linux for port 5432 you could do:
Also for other distributions you could use:
Notice you can specify the matching exit status with |
👍 Would much prefer a POSIX version, but @ettore26's solution should be good enough for now. |
hey guys, maybe a bit late for the party, but there is another (POSIX shell compliant) alternative capable of waiting for any type of command called: wtfc. |
I'd rather using nc command on alpine to wait for tcp connection.
|
That would be awesome !
The text was updated successfully, but these errors were encountered: