question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

not working on alpine 3.10 with bash installed

See original GitHub issue

we use wait-for-it.sh heavily in CI for docker integration testing in golang. Recently a job broke due to wait-for-it.sh error. I believe the issue may have to do with something changing in timeout from alpine3.9 (works) to alpine 3.10 (not working). In both cases we were installing bash with apk.

Repro (note in vi I am copying wait-for-it from current master)

$ docker run -it --rm golang:1.12-alpine
/go # vi wait-for-it.sh
/go # chmod +x wait-for-it.sh 
/go # apk update && apk add --no-cache bash
fetch http://dl-cdn.alpinelinux.org/alpine/v3.10/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.10/community/x86_64/APKINDEX.tar.gz
v3.10.1-11-g89d0862481 [http://dl-cdn.alpinelinux.org/alpine/v3.10/main]
v3.10.1-12-ga885fe876c [http://dl-cdn.alpinelinux.org/alpine/v3.10/community]
OK: 10327 distinct packages available
fetch http://dl-cdn.alpinelinux.org/alpine/v3.10/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.10/community/x86_64/APKINDEX.tar.gz
(1/5) Installing ncurses-terminfo-base (6.1_p20190518-r0)
(2/5) Installing ncurses-terminfo (6.1_p20190518-r0)
(3/5) Installing ncurses-libs (6.1_p20190518-r0)
(4/5) Installing readline (8.0.0-r0)
(5/5) Installing bash (5.0.0-r0)
Executing bash-5.0.0-r0.post-install
Executing busybox-1.30.1-r2.trigger
OK: 15 MiB in 20 packages
/go # ./wait-for-it.sh docker:5432
timeout: unrecognized option: t
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.
wait-for-it.sh: timeout occurred after waiting 15 seconds for docker:5432

Workaround: I was able to work around this issue by installing coreutils as well which updates timeout (continuing from example above)

/go # apk update && apk add --no-cache coreutils
fetch http://dl-cdn.alpinelinux.org/alpine/v3.10/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.10/community/x86_64/APKINDEX.tar.gz
v3.10.1-11-g89d0862481 [http://dl-cdn.alpinelinux.org/alpine/v3.10/main]
v3.10.1-12-ga885fe876c [http://dl-cdn.alpinelinux.org/alpine/v3.10/community]
OK: 10327 distinct packages available
fetch http://dl-cdn.alpinelinux.org/alpine/v3.10/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.10/community/x86_64/APKINDEX.tar.gz
(1/3) Installing libacl (2.2.52-r6)
(2/3) Installing libattr (2.4.48-r0)
(3/3) Installing coreutils (8.31-r0)
Executing busybox-1.30.1-r2.trigger
OK: 16 MiB in 23 packages
/go # ./wait-for-it.sh -t 15 docker:5432
wait-for-it2.sh: waiting 15 seconds for docker:5432
wait-for-it2.sh: timeout occurred after waiting 15 seconds for docker:5432

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:40
  • Comments:17 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
TZK-commented, Sep 20, 2019

Thanks for the workaround @JoshKCarroll Works well by installing coreutils 😉

2reactions
tillkuhncommented, Sep 18, 2019

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Docker: How to use bash with an Alpine based docker image?
Alpine docker image doesn't have bash installed by default. You will need to add the following commands to get bash : RUN apk...
Read more >
How to install bash shell in Alpine Linux - nixCraft
This page explains how to install bash shell in Alpine Linux using the apk command including setting up command-line tab-completion for ...
Read more >
alpine - Official Image | Docker Hub
A minimal Docker image based on Alpine Linux with a complete package index and only 5 MB in size!
Read more >
Making Our Own Alpine Node.js Container
FROM alpine:3.10 RUN apk add --update nodejs npm ... if you run into issues with versions, continue with alpine:3.10 instead of alpine:latest ....
Read more >
Alpine Linux: index
Small. Simple. Secure. Alpine Linux is a security-oriented, lightweight Linux distribution based on musl libc and busybox.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found