diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 54e7c73..cd7c3d8 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -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: diff --git a/entrypoint.sh b/entrypoint.sh index f37126f..d168520 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -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 \ No newline at end of file +if [ -n "$DOCKER_PID" ]; then + kill ${DOCKER_PID} +fi +exit $R