You can issue a
gcloud auth login command to log in and be authenticated.
gcloud auth application-default to generate application default credentials.
If you are running your project using a Docker container,
you can use local credentials with your container in a very straight forward way.
You only need
gcloud CLI installed on your Docker image or using the
and using the following trick using
docker run -v ~/.config/gcloud:/root/.config/gcloud your_docker_image
-v flag instructs Docker to mount
the folder with your local machine credentials
inside your Docker image.