Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WARNING: buildx: failed to read current commit information with git rev-parse --is-inside-work-tree

Tags:

git

docker

gradle

I am getting this warning which idk what it means but couldn't get it over my head Here is the docker file, it is a multistage for a gradlew build

# Building a multistage dockerfile and that's why we use "as"
# building a code doesn't need gradle installed thaat's why jdk image is only needed

FROM openjdk:11 as base 
WORKDIR /app
#FIRST dot current directory to the other dot (work directory)
COPY . .
RUN chmod +x gradlew
RUN ./gradlew build

FROM tomcat:9
WORKDIR webapps
COPY --from=base /app/build/libs/sampleWeb-0.0.1-SNAPSHOT.war .
RUN rm -rf ROOT && mv sampleWeb-0.0.1-SNAPSHOT.war ROOT.war

doesn't seem to have to do anything with this but i am not that familiar with java app dev just general knowledge. building it on Windows and I didn't see that warning just on the Linux machine. and if it is git related i have it installed.

I didn't know where to look for, google and chatgpt was no help

like image 312
Lutfi Alfawadleh Avatar asked Apr 27 '26 00:04

Lutfi Alfawadleh


1 Answers

i just do:

git config --global --add safe.directory <your dir app>

and this warning desapear.

like image 193
Nelson Matenda Avatar answered Apr 29 '26 13:04

Nelson Matenda



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!