Issue has been solved. git update-index --chmod=+x gradlew followed by git commit solved the issue. I kept committing through IntelliJ’s built-in Git feature which seems not able to commit the chmod bit.
If you had added chmod +x ./gradlew to the build script section, it would have worked. I thought is was an issue where the permissions were changing when the build cloned the repo within the container. I was able to get it to work with the above script line but I wanted to figure out how it was changing.
Your solution saved me a bunch of time since it was something I could fix by updating git locally.