I’m trying to create a cron job that will execute a BigQuery query. To do so, I put my query in a bash script (main.sh) and dropped it in a cron job based on a docker environment with a service account key as an environment file.
My Dockerfile was:
RUN gcloud auth activate-service-account firstname.lastname@example.org --key-file=/etc/secrets/service_account_key.json --project=scaledata
COPY main.sh main.sh
This failed to build because the environment file appears not to be available. So I moved the auth command into the bash script. The environment file works there but the process attempts to save something to a config file that is read-only.
Any suggestions on how to give service account credentials to my cron job so it can call this google api?