Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix race condition for Docker local tests #1384

Merged
merged 3 commits into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions dev-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -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 "$@"
3 changes: 3 additions & 0 deletions dev.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Loading