dockergoogle-cloud-platformgoogle-cloud-run

How do I retrieve the source code of a deployment on Cloud Run?


I need to retrieve the source code from a Google Cloud Run deployment. I have complete access to the deployments and I need to get back the code because it got wrangled up on my computer. How do I get it back?

So far, I have managed to get the image.tar and extract it but nothing useful is there in it.

Edit: My code is a flask app with a main.py file and a bunch of html templates.


Solution

  • Unlike Cloud Functions where your source code is automatically uploaded to GCS as a zip file, Cloud Run does not keep your source code, as you are responsible for packaging your application and its dependencies into a container image before deployment.