For anyone dealing with similar issues:
Try adding at least a 20 second sleep in your entrypoint (untested, but it might help).
However, what definitely works 100%: put everything needed directly into the Docker image (e.g. handle git clone and similar tasks during the Docker build, not at runtime). This way, everything just works.