Code Monkey home page Code Monkey logo

Comments (17)

TZK- avatar TZK- commented on July 21, 2024 3

Thanks for the workaround @JoshKCarroll
Works well by installing coreutils ๐Ÿ˜‰

from wait-for-it.

tillkuhn avatar tillkuhn commented on July 21, 2024 2

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.

riptusk331 avatar riptusk331 commented on July 21, 2024 1

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.

pascalandy avatar pascalandy commented on July 21, 2024 1

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.

arthens avatar arthens commented on July 21, 2024

I can confirm the issue, we are getting the same problem.

from wait-for-it.

fr05t1k avatar fr05t1k commented on July 21, 2024

#68

from wait-for-it.

YumaInaura avatar YumaInaura commented on July 21, 2024
  • 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.

YumaInaura avatar YumaInaura commented on July 21, 2024
  • 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.

YumaInaura avatar YumaInaura commented on July 21, 2024

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.

iturgeon avatar iturgeon commented on July 21, 2024

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.

Stratus3D avatar Stratus3D commented on July 21, 2024

I think you are right @riptusk331 . Is there a popular fork of this repo?

from wait-for-it.

robertp-indeed avatar robertp-indeed commented on July 21, 2024

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.

xtrasimplicity avatar xtrasimplicity commented on July 21, 2024

@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.

pascalandy avatar pascalandy commented on July 21, 2024

Anyone have a dockerfile for alpine. Would love to try this using a docker run.

Cheers!

from wait-for-it.

gioamato avatar gioamato commented on July 21, 2024

@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.

gioamato avatar gioamato commented on July 21, 2024

@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.

pascalandy avatar pascalandy commented on July 21, 2024

Got it about the layer :-p

from wait-for-it.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.