Closed balintant closed 7 years ago
hi @balintant ,
First of all thanks for the PR!! But I'm confused if this feature is really worth. Seems you could achieve the same with:
waitforit -full-connection=http://google.com -timeout=20 -debug && echo "Google Works!"
If is possible to achieve the same with simple shell commands I think there is no really benefit to increase the codebase adding this feature.
hi @maxcnunes,
I think that must be true, but somehow it isn't. I wasted half my Saturday with that, and finally, I extended the code, so it works for me.
Other wait-for [1, 2] packages recommended by Docker also include the command args part. I think they also experienced the issue.
(Note, those packages are not good for me as running them on scratch
is the main point here.)
I created an example that you can replicate the issue with: https://gist.github.com/balintant/5edac5302705b98dffe56c7fb1878729
Humm. That probably would work by replacing:
command: /waitforit -full-connection=tcp://db:3306 -debug && /app
With:
command: sh -c "/waitforit -full-connection=tcp://db:3306 -debug && /app"
But because you are using a scratch
image the sh
isn't available.
Since there is need to keep images the smallest possible then this feature makes sense.
I will just try to change a bit your code to use the same approach used by the other tools by passing the additional args after --
command.
Thanks @balintant!!
Lol, I didn't even think of &&
not works because scratch
is running no sh
. That's so natural already.
I will just try to change a bit your code to use the same approach used by the other tools by passing the additional args after
--
command.
I wanted to do the same, but at last, I decided less code is more valuable here.
Thanks, @maxcnunes!
Add possibility to run commands within
waitforit
.