本文介绍了使用Docker Desktop在本地调试部署到Kubernetes的应用程序的最佳方法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有使用Docker开发相对复杂的应用程序的经验.使用Visual Studio(2019)调试应用非常容易.我只是将docker-compose.yaml设置为启动应用程序并开始调试.

I have experience using Docker to develop a relatively complex application. It is very easy to debug an app using Visual Studio (2019). I just set docker-compose.yaml as the startup app and start debugging.

是否可以使用Docker Desktop调试在本地发布到Kubernetes的应用程序?通过调试,我的意思是设置断点等?我花了几个小时在谷歌上搜索,却一无所获,因此提出了问题的原因.

Is it possible to debug an application that is published to Kubernetes locally using Docker Desktop? By debug I mean set breakpoints etc? I have spent a few hours Googling this and I have got nowhere and hence the reason for the question.

请注意,我并不是在问如何调试在Cloud中发布到Kubernetes的应用程序,例如Azure-有很多网页说明了如何做到这一点.

Please note that I am not asking how to debug an app that is published to Kubernetes in the Cloud e.g. Azure - there are plenty of webpages that explain how to do that.

推荐答案

假定映像使用Java CMD,请包括标准调试JVM参数(),然后在运行容器时公开调试端口,并在IDE中在容器启动后在该端口上设置远程调试会话上.

Assuming the image uses a Java CMD, include the standard debug JVM arguments (What are Java command line options to set to allow JVM to be remotely debugged?), then expose the debug port when running a container, and in IDE set up a remote debug session on that port once the container starts up.

这篇关于使用Docker Desktop在本地调试部署到Kubernetes的应用程序的最佳方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-28 18:26