Skip to content

Commit

Permalink
improve entrypoint
Browse files Browse the repository at this point in the history
  • Loading branch information
vdebergue committed Feb 24, 2023
1 parent 4d14285 commit 4e29f9d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ jobs:
${{ secrets.harbor_registry }}/${{ secrets.harbor_repo }}
tags: |
type=raw,value=latest,enable={{is_default_branch}}
type=raw,value={{date 'YYYYMMDD'}}
type=sha
type=schedule,pattern={{date 'YYYYMMDD'}}
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
Expand Down
24 changes: 15 additions & 9 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
#!/bin/bash
if [ ! -S /var/run/docker.sock ]; then
echo "Starting Docker daemon ..."
dockerd --host=unix:///var/run/docker.sock \
--host=tcp://0.0.0.0:2375 &> /dev/null &
DOCKER_PID=$!

echo "Starting Docker daemon ..."
dockerd --host=unix:///var/run/docker.sock \
--host=tcp://0.0.0.0:2375 &> /dev/null &
DOCKER_PID=$!
while ! docker info > /dev/null
do sleep 1
done
fi

while ! docker info > /dev/null
do sleep 1
done
# Avoid issues with git
git config --global --add safe.directory '*'

chmod u+x /usr/local/bin/*.py
/usr/local/bin/build.py $@
R=$?
kill ${DOCKER_PID}
exit $R
if [ -n "$DOCKER_PID" ]; then
kill ${DOCKER_PID}
fi
exit $R

0 comments on commit 4e29f9d

Please sign in to comment.