如何从Kubernetes上的JAR文件中部署Spring Boot应用程序源代码。

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

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.

huangapple
  • 本文由 发表于 2020年9月16日 16:09:23
  • 转载请务必保留本文链接:https://go.coder-hub.com/63915749.html
匿名

发表评论

匿名网友

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

确定