Last active
October 11, 2022 18:16
-
-
Save kiorky/3b48246bd911847875ae3d37dd610713 to your computer and use it in GitHub Desktop.
dockermachinewrapper
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
#!/bin/bash | |
set -ex | |
wait_ready() { s="${s:-0.5}";t="${t:-800}";start=$(date +%s);until ("$@";);do | |
d=$(date +%s);dt=$((${d}-${start}));if [ ${dt} -gt ${t} ];then log " no more retries: $@";return 1;fi | |
if [ $(( ${dt} % ${CI_OPEN_MSG_DELAY:-240} )) -eq 0 ];then log " CI keeps open";fi | |
(cat /dev/zero|read -t ${s}||exit 0);done; } | |
t=300 wait_ready docker version | |
curl -fsSL https://get.docker.com > docker.sh | |
chmod +x docker.sh | |
sudo ./docker.sh "$@" | |
systemctl restart docker | |
t=300 wait_ready docker version |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment