Is it possible to mount file to the docker container running in Google Cloud Run

Viewed 239

I have a docker image that I run in Google Cloud Run. The app inside the image needs a config file /etc/app.conf. In my image there is no such file.

When I run it local I can mount the config file from my computer inside the container:

docker run --detach --volume=`pwd`/app.conf:/etc/app.conf myimage

Is there a way to mount a file in Google Cloud Run?

(Now I'm just creating a new image based on my original image that has that file, but I would like to simplify this process)

1 Answers

Yes, you can cheat and mount this file in read only mode. The trick is to use Secret Manager.

The file is in read only, but it works.

However, keep in mind that you have limitations:

  • the file can't be larger 64KiB -> Large files aren't supported, but fit conf file.
  • You are limited to 90k access per minute

And cost associated:

  • $0.06 per active secret version
  • $0.03 per 10k read
Related