Skip to content

Commit a1e693e

Browse files
dockerfiles: replace wait-for-it dependency with simple bash loop
Instead of relying on an external repository that basically does the same job, use a simple loop opening a socket via bash's pseudo-device files below /dev/tcp instead. Signed-off-by: Bastian Krause <bst@pengutronix.de>
1 parent 1a52b69 commit a1e693e

2 files changed

Lines changed: 4 additions & 5 deletions

File tree

dockerfiles/Dockerfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ RUN set -e ;\
1111
apt install -q=2 --yes --no-install-recommends python3 python3-dev python3-pip python3-setuptools git build-essential libsnappy-dev ;\
1212
pip3 install --break-system-packages -U pip;\
1313
apt clean ;\
14-
rm -rf /var/lib/apt/lists/* ;\
15-
git clone https://github.com/vishnubob/wait-for-it.git opt/wait-for-it && cd opt/wait-for-it && git reset --hard 54d1f0bfeb6557adf8a3204455389d0901652242
14+
rm -rf /var/lib/apt/lists/*
1615

1716
#
1817
# Client

dockerfiles/staging/docker-compose.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ services:
1717
stdin_open: true
1818
network_mode: "host"
1919
tmpfs: "/tmp"
20-
# Use wait-for-it to ensure exporter service is up, as exporter is assuming exporter to
20+
# Wait until coordinator is up
2121
# Use labgrid-client r to ensure the exporter has populated the resource list in the coordinator
2222
# Use sleep to fix the problem that sometimes the coordinator is not ready even though the service is up
2323
command: timeout 60 bash -c "set -e &&
2424
cd /simple-test &&
25-
/opt/wait-for-it/wait-for-it.sh 127.0.0.1:20408 &&
25+
until echo > /dev/tcp/localhost/20408; do sleep 1; done &&
2626
sleep 5 &&
2727
while [ -z $$(/usr/local/bin/labgrid-client r) ]; do echo 'Wait one sec on coordinator' && sleep 1; done &&
2828
/usr/local/bin/labgrid-client -p example-place lock &&
@@ -43,7 +43,7 @@ services:
4343
network_mode: "host"
4444
stdin_open: true
4545
command: bash -c "set -e &&
46-
/opt/wait-for-it/wait-for-it.sh 127.0.0.1:20408 -- labgrid-exporter /opt/conf/exporter.yaml"
46+
until echo > /dev/tcp/localhost/20408; do sleep 1; done && labgrid-exporter /opt/conf/exporter.yaml"
4747
dut:
4848
build:
4949
context: "./dut"

0 commit comments

Comments
 (0)