简体   繁体   English

如何在 Google Cloud Run 中运行 go-cloud-debug-agent,以便我可以在 Stackdriver Debug 中调试我的 go 应用程序

[英]How to run go-cloud-debug-agent in Google Cloud Run so that I can debug my go app in Stackdriver Debug

I'm trying to run go-cloud-debug-agent within Cloud Run我正在尝试在 Cloud Run 中运行 go-cloud-debug-agent

FROM golang:1.13.1 
RUN go get -u cloud.google.com/go/cmd/go-cloud-debug-agent
RUN mkdir -p /go/src/xyz
WORKDIR /go/src/xyz
COPY . .

RUN go build -gcflags=all='-N -l' -o main .


EXPOSE 8080
ENTRYPOINT ["go-cloud-debug-agent","-projectid=someproject-12313423","-appmodule=main","-appversion=1.0","--","/go/src/xyz/main"]

Unfortunately when trying to deploy it to Cloud Run I see following error in the Stackdriver Logging不幸的是,在尝试将其部署到 Cloud Run 时,我在 Stackdriver Logging 中看到以下错误

Error loading program: AttrStmtList not present or not int64 for unit 98

Anyone has any clue how to use go-cloud-debug-agent with Cloud Run?任何人都知道如何将 go-cloud-debug-agent 与 Cloud Run 一起使用?

As @JohnHanley pointed I had to change the golang version to 1.11 to be compatibile with debug agent.正如@JohnHanley 指出的那样,我必须将 golang 版本更改为 1.11 才能与调试代理兼容。 To conclude the following Dockerfile should run in Cloud Run any golang code and let you use Stackdriver Debug with it.总结以下 Dockerfile 应该在 Cloud Run 中运行任何 golang 代码,并让您使用 Stackdriver Debug 与它。

FROM golang:1.11
RUN go get -u cloud.google.com/go/cmd/go-cloud-debug-agent
RUN mkdir -p /go/src/xyz
WORKDIR /go/src/xyz
COPY . .

RUN go build -gcflags=all='-N -l' -o main .


EXPOSE 8080
ENTRYPOINT ["go-cloud-debug-agent","-projectid=someproject-12313423","-appmodule=main","-appversion=1.0","--","/go/src/xyz/main"]

GCP should post some examples as from their current documentation I can deduct there is no way to run go-cloud-debug-agent on Cloud Run and that Cloud Run is not supported. GCP 应该从他们当前的文档中发布一些示例,我可以推断出无法在 Cloud Run 上运行 go-cloud-debug-agent 并且不支持 Cloud Run。

Go is not supported for Cloud Run at the moment. Cloud Run 目前不支持 Go。 Here is a list of the supported languages and platforms for Debugger: https://cloud.google.com/debugger/docs/setup/以下是 Debugger 支持的语言和平台列表: https://cloud.google.com/debugger/docs/setup/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM