diff --git a/dev-entrypoint.sh b/dev-entrypoint.sh new file mode 100755 index 000000000..151e6dba2 --- /dev/null +++ b/dev-entrypoint.sh @@ -0,0 +1,7 @@ +#!/bin/sh +while ! git rev-parse --is-inside-work-tree >/dev/null 2>&1; do + echo "Waiting for Git to be ready..." + sleep 1 +done +# Pass control to main container command +exec "$@" diff --git a/dev.Dockerfile b/dev.Dockerfile index a1c9a5585..63976bd6f 100644 --- a/dev.Dockerfile +++ b/dev.Dockerfile @@ -31,3 +31,6 @@ RUN git config --global --add safe.directory /var/cartography && \ git config --local user.name "cartography" USER ${uid}:${gid} + +# Wait for git to be ready before running anything else. Fix race condition. +ENTRYPOINT ["/var/cartography/dev-entrypoint.sh"]