Enter a docker container running with Google Cloud Run

只谈情不闲聊 提交于 2020-12-30 06:12:13

问题


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.


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/56342904/enter-a-docker-container-running-with-google-cloud-run

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!