-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Multiarch and dockerhost wait entrypoint
- Loading branch information
Blaize Kaye
committed
Jul 28, 2024
1 parent
384e920
commit 4720e75
Showing
2 changed files
with
29 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
# try connect to docker-host 10 times before giving up | ||
DOCKER_HOST_COUNTER=1 | ||
DOCKER_HOST_TIMEOUT=10 | ||
until docker -H ${DOCKER_HOST} info &> /dev/null | ||
do | ||
if [ $DOCKER_HOST_COUNTER -lt $DOCKER_HOST_TIMEOUT ]; then | ||
let DOCKER_HOST_COUNTER=DOCKER_HOST_COUNTER+1 | ||
echo "${DOCKER_HOST} not available yet, waiting for 5 secs" | ||
sleep 5 | ||
else | ||
echo "could not connect to ${DOCKER_HOST}" | ||
exit 1 | ||
fi | ||
done |