最佳的开发和调试工作流程是首先在 Docker 环境中部署。

huangapple go评论92阅读模式
英文:

Best workflow for developing and debugging - initially deploy in a docker environment

问题

在Docker容器中编程Go语言,还是不要使用容器?

最近我一直在寻找一个好的方式来编程、调试并最终部署到Docker环境中。

  1. 我尝试了使用VS Code通过Delve调试容器,但是很难附加到调试器上。
  2. 使用Eclipse Che,但是IDE不支持。

既然Docker是用Go语言编写的,Docker的开发团队应该有一个很好的工作流程吧?

也许结论是,我不应该在容器内开发和调试,而是应该在主机上进行开发和调试,只有在编译成容器后才进行部署。

你有什么经验可以分享吗?

英文:

Programming Go in a Docker container or not?

For some time now, I have looked for a good way to program, debug and finally deploy to Docker environment.

  1. I have looked at VS Code, debugging into a container via Delve. It is difficult to attach to the debugger.
  2. Using Eclipse Che, not supported in the IDE.

Since Docker is written in Go - the good people at Docker - they must have a good workflow?

Maybe the conslusion is, that I should not develope and debug inside a container but from host machine - and then only deploy when compiled into a container.

What is you experience?

答案1

得分: 0

我们现在使用Docker来交付我们的产品,就像你说的那样,我们从主机机器上开发和调试它们。如果我们遇到一些在运行时环境中难以重现的问题,我们会将调试二进制文件附加到Docker镜像中,以替换内置的文件。

英文:

We are using docker to deliver our products nowadays, and just like you said, we develop and debug them from the host machine. And if we meet some issue which is hard to repo with the runtime enviroment staff, we attach the debug binary to the docker image to replace the built in ones.

huangapple
  • 本文由 发表于 2017年6月1日 15:49:08
  • 转载请务必保留本文链接:https://go.coder-hub.com/44301592.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定