I have a project in which I need to use gcloud commands, I need to build with the proper credentials, seems gcloud commands don't use the variable GOOGLE_APPLICATION_CREDENTIALS, so I set the auth in RUN step in docker
FROM google/cloud-sdk
COPY . usr/src/app
WORKDIR /usr/src/app
RUN gcloud auth activate-service-account --key-file=/usr/src/app/credentials.json
but when I build the image and enter to the container I have no access to gcloud commands, lets say
gcloud projects list
I have the next answer
WARNING: Could not open the configuration file: [/root/.config/gcloud/configurations/config_default]. ERROR: (gcloud.projects.list) You do not currently have an active account selected.
credentials are inside the container because if I do manually I can run the next command and everything works well.
gcloud auth activate-service-account --key-file=/usr/src/app/credentials.json
how can add the credentials to exist by default in build?, does the RUN step may not take effect when building the image.