I have the same problem. I just created a very simple build image and added bash, git and java. When pulling the image locally and checking the packages are installed everything is working perfectly:
$ docker run -it reflectoring/build-image-java:latest /bin/sh
/ # git --version
git version 2.11.1
/ # bash --version
GNU bash, version 4.3.46(1)-release (x86_64-alpine-linux-musl)
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
/ # java -version
openjdk version "1.8.0_121"
OpenJDK Runtime Environment (IcedTea 3.3.0) (Alpine 8.121.13-r0)
OpenJDK 64-Bit Server VM (build 25.121-b13, mixed mode)
As soon as my PR build (org: reflectoring PR #208) picks up my image, I get an error
Warning: Git is not installed in the image. Falling back to CircleCI’s native git client but this is still an experiment feature. We highly recommend using an image that has official Git installed.
Counting objects: 3806, done.
Compressing objects: 100% (64/64), done.
Total 3806 (delta 12), reused 0 (delta 0), pack-reused 3728
reference not found
This is my Dockerfile and this my circle ci configuration.
This should serve well as a minimal example on how to reproduce the bug.