Comments (17)
Thanks for the workaround @JoshKCarroll
Works well by installing coreutils ๐
from wait-for-it.
This breaking change in BusyBox ("timeout: fix arguments to match coreutils") seems to be the reason, I just ran into the same issue after our build image was updated to alpine:3.10
from wait-for-it.
Ran into this issue and confirming @JoshKCarroll's workaround (installing coreutils) works. The maintainer @vishnubob seems to have abandoned this project...no responses to issues, last commit over a year ago, and there are 25 pull requests...2 of which try to fix this problem.
we're on our own!
from wait-for-it.
Thanks @gioamato. If I understood:
a Dockerfile for alpine
# inspiration
FROM alpine:3.12
COPY wait-for-it.sh /usr/local/bin/wait-for-it
RUN set -eux &&\
apk --update add --no-cache bash coreutils &&\
chmod +x /usr/local/bin/wait-for-it
from wait-for-it.
I can confirm the issue, we are getting the same problem.
from wait-for-it.
from wait-for-it.
- I needs wait-for-it sh script changing
- maybe it is bad if statement judge busybox
how to resolve ?
- change if statement
- ah maybe it is bad method...
- if help include some text then enable -t option
/ # timeout --help 2>&1 | grep '\-t SECS'
Usage: timeout [-t SECS] [-s SIG] PROG ARGS
or Specify ENV and run script
WAITFORIT_BUSYTIMEFLAG="-t" wait-for-it.sh
and use it in wait-for-it.sh script without if else match in busybox.
from wait-for-it.
- A Trouble log I found
- probably same trouble as other people
e.g A docker image xueshanf/awscli
- WAITFORIT_TIMEOUT_PATH has
/bin/busybox
- But timeout command does not have
-t SEC
option - Is this a trouble of only
xueshanf/awscli
image?
$ docker run -it --entrypoint= xueshanf/awscli bash
bash-5.0# WAITFORIT_TIMEOUT_PATH=$(type -p timeout)
bash-5.0# WAITFORIT_TIMEOUT_PATH=$(realpath $WAITFORIT_TIMEOUT_PATH 2>/dev/null || readlink -f $WAITFORIT_TIMEOUT_PATH)
bash-5.0# echo $WAITFORIT_TIMEOUT_PATH
/bin/busybox
bash-5.0# timeout
BusyBox v1.30.1 (2019-06-12 17:51:55 UTC) multi-call binary.
Usage: timeout [-s SIG] SECS PROG ARGS
Runs PROG. Sends SIG to it if it is not gone in SECS seconds.
Default SIG: TERM.
bash-5.0#
trouble
- it happens trouble in if statement in script
# check to see if timeout is from busybox?
WAITFORIT_TIMEOUT_PATH=$(type -p timeout)
WAITFORIT_TIMEOUT_PATH=$(realpath $WAITFORIT_TIMEOUT_PATH 2>/dev/null || readlink -f $WAITFORIT_TIMEOUT_PATH)
if [[ $WAITFORIT_TIMEOUT_PATH =~ "busybox" ]]; then
WAITFORIT_ISBUSY=1
WAITFORIT_BUSYTIMEFLAG="-t"
else
WAITFORIT_ISBUSY=0
WAITFORIT_BUSYTIMEFLAG=""
fi
from wait-for-it.
directly change wait-for-it.sh
# check to see if timeout is from busybox?
WAITFORIT_TIMEOUT_PATH=$(type -p timeout)
WAITFORIT_TIMEOUT_PATH=$(realpath $WAITFORIT_TIMEOUT_PATH 2>/dev/null || readlink -f $WAITFORIT_TIMEOUT_PATH)
if [[ $WAITFORIT_TIMEOUT_PATH =~ "busybox" ]]; then
WAITFORIT_ISBUSY=1
WAITFORIT_BUSYTIMEFLAG="-t"
else
WAITFORIT_ISBUSY=0
WAITFORIT_BUSYTIMEFLAG=""
fi
+ if [[ ! -z "${WAITFORIT_NO_BUSYTIMEFLAG}" ]]; then
+ WAITFORIT_BUSYTIMEFLAG=""
+ fi
WAITFORIT_NO_BUSYTIMEFLAG=1 wait-for-it.sh
from wait-for-it.
Hopefully #81 solves this for you guys. The script still requires the use of bash on Alpine, but it should detect newer versions of BusyBox and deal with the updated flags appropriately.
from wait-for-it.
I think you are right @riptusk331 . Is there a popular fork of this repo?
from wait-for-it.
Ah, I opened another PR that fixes the issue (but doesn't preserve backwards compat, so @iturgeon's is better) because I didn't read existing issues closely enough first.
from wait-for-it.
@douglas-gibbons , @vishnubob - Any chance one of the PRs that patch this issue can be merged? Has this repo been abandoned? If so, would someone else here be able to take over maintenance?
Thanks!
from wait-for-it.
Anyone have a dockerfile for alpine. Would love to try this using a docker run.
Cheers!
from wait-for-it.
@pascalandy used in the project https://github.com/gioamato/stateless-wordpress
The implementation is inside NGINX Dockerfile: https://github.com/gioamato/stateless-wordpress/blob/master/nginx/Dockerfile
from wait-for-it.
@pascalandy exactly. I suggest you to install dependencies first and then copy wait-for-it as the last thing. Doing so you will not invalidate docker build layers if you update wait-for-it script (Ref.: https://docs.docker.com/develop/develop-images/dockerfile_best-practices)
from wait-for-it.
Got it about the layer :-p
from wait-for-it.
Related Issues (20)
- Use within dockerfile before running another command against now running app HOT 4
- Is it possible to wait for a specific path? HOT 3
- timeout command not on macOS HOT 8
- Update debian package HOT 1
- Add option to use nc (netcat) instead o bash /dev/tcp/ HOT 1
- Can multiple be supported๏ผ HOT 4
- Wait for it is not working with node:17-alpine HOT 3
- Can you please explain to me when I need to use this project? HOT 2
- Request to have a shell version of the script HOT 4
- Mistakenly submitted issue
- Support for IPv6 addresses HOT 3
- Script timesout (No such file or directory) while running with bash command HOT 2
- Support logging to stdout
- Bug: Wrong error message when the value for -t is not given
- Not working on windows 11
- Line 75 syntax error HOT 1
- Raw shell script URL `500`
- Enable TravisCI
- Debian tracker and policy recommendation flag
- How to wait for multiple ports to be ready? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wait-for-it.