英文:
how to spring boot application source code from jar file on kubernetes
问题
我想查看我的应用程序的源代码(my-app.jar)。这是一个Spring Boot应用程序。我该如何查看它?
摘要 - 我想查看部署在Kubernetes Pod上的Spring Boot项目的控制器文件。
英文:
➜ ~ kubectl exec -it my_pod /bin/sh -n my_team
sh-4.2$ ls
elastic-apm-agent.jar logs run.sh my-app.jar
sh-4.2$
I want to see my application's source code (my-app.jar). This is a spring boot application. How can i see it?
Summary - I want to view a controller file of my spring boot project which is deployed on k8 pod.
答案1
得分: 2
对于编译型语言(Java、C++、Rust、Go等),典型的Docker镜像不会包含其源代码,在类似Kubernetes的环境中源代码将完全不存在。您需要找到其他途径来检索它,比如原始的源代码仓库。
而这与解释型语言(Python、JavaScript、Ruby等)不同,这些语言需要源代码才能运行应用程序,对于这些语言,源代码可以轻松地从镜像或部署环境中提取出来。
英文:
For compiled languages (Java, C++, Rust, Go, ...) a typical Docker image won't contain its source code, and that source code won't be present at all in an environment like Kubernetes. You need to find some other path to retrieve it, like the original source-code repository.
This differs from interpreted languages [Python, Javascript, Ruby, ...] where the source code is required to run the application, and for those languages it can be easily extracted from the image or the deployment environment.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论