@felipeespitalher a similar situation has been addressed in this previous post
I would install the gcloud
client in the circleci/openjdk:11-jdk
image in the pipeline and eliminate the google/cloud-sdk
image. Below is an example of how to do this:
curl -o gcp-cli.tar.gz https://dl.google.com/dl/cloudsdk/channels/rapid/google-cloud-sdk.tar.gz
tar -xzvf gcp-cli.tar.gz
echo ${GOOGLE_CLOUD_KEYS} | base64 --decode --ignore-garbage > ${HOME}/.ssh/cicd_demo_gcp_creds.json
./google-cloud-sdk/install.sh --quiet
echo 'export PATH=$PATH:~/google-cloud-sdk/bin' >> $BASH_ENV
source $BASH_ENV
gcloud auth activate-service-account --key-file ${HOME}/.ssh/cicd_demo_gcp_creds.json
You could also use the gcloud CirlcleCI orbs to install the client as well.