Skip to content

Commit

Permalink
Merge pull request #6 from mobilecoinofficial/capture-tag-from-commit
Browse files Browse the repository at this point in the history
add wait for docker script [tag/2.310.0]
  • Loading branch information
jgreat authored Jan 16, 2024
2 parents 8222dce + 4cf6b64 commit 3028f28
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,6 @@ RUN apt-get update \
&& apt-get clean \
&& rm -r /var/lib/apt/lists/*

COPY wait_for_docker_then_run.sh /usr/local/bin/wait_for_docker_then_run.sh

USER runner
21 changes: 21 additions & 0 deletions wait_for_docker_then_run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash

# Wait for docker socket to exist.

docker_socket=/run/docker/docker.sock
count=0

while [[ ! -S "${docker_socket}" ]]
do
echo "Waiting for ${docker_socket}"
sleep 1

count=$((count+1))
if [[ ${count} -gt 60 ]]
then
echo "Timed out waiting for docker socket"
exit 1
fi
done

/home/runner/run.sh

0 comments on commit 3028f28

Please sign in to comment.