Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Enter a docker container running with Google Cloud Run

Is it possible to enter a container powered by Google Cloud Run? Something in the manner of docker exec -it CONTAINER /bin/bash?

I'm facing a bug i can't reproduce running a container based on the very same image neither locally nor using Google Cloud Shell to run that container.
I'm not picky regarding whether it comes to using Cloud Shell to connect to Cloud Run or doing so from my local environment.

like image 729
nichoio Avatar asked May 28 '19 13:05

nichoio


People also ask

Where can Docker containers be run in GCP?

You can run containers on Linux or Windows Server public VM images, or on a Container-Optimized OS image. Containers let your apps run with fewer dependencies on the host virtual machine (VM) and run independently from other containerized apps that you deploy to the same VM instance.


Video Answer


2 Answers

Yes you can, with a slight hack - I've released an example here https://github.com/matti/google-cloud-run-shell

You just need to copy these binaries over to your container and establish the reverse shell access through heroku or something similar.

like image 92
matti Avatar answered Oct 15 '22 12:10

matti


Is it possible to enter a container powered by Google Cloud Run?

No, the only port you can access the service is $PORT (currently 8080) and only via HTTP/HTTPS requests.

You will need to debug the old fashioned way: logging statements to Google Stackdriver - which is already built-in to Cloud Run, just do "logging.info(...)" for your language.

If your problem is container startup, check Stackdriver for error messages.

like image 43
John Hanley Avatar answered Oct 15 '22 12:10

John Hanley