GCP Cloud Build based on Trigger of Java Code Pushed in Bit Bucket

I am trying to GCP Cloud Build based on Trigger of Spring Boot java Application Code Pushed in Bit Bucket. so far I am doing it manually, coping code into GCP VM, build there, create Docker Image, push to GCP Container Registry and Deploy on Kubernetes Engine which is working fine. I need to automate the build on the basis of the trigger every time I push the code.
I have code on my private bitbucket. GCP Container Registry has access to my Bitbucket Repository.
my docker file is

SpringBootApplication.jar is not available-- no such file or directory.

I know it because on GCP VM I have not clone and build the code.
do I have to write clone and build code in Dockerfile as well ??
if yes then what’s the point of authenticating Bitbucket with GCP Cloud Build.