简体   繁体   English

Jenkins jar vs dockerfile

[英]Jenkins jar vs dockerfile

I started learning devops recently. 我最近开始学习devop。 Guys I have a doubt here please solve. 伙计们,我对此有疑问,请解决。 After testing Jenkins package everything including code and dependencies into a war/jar file. 测试完Jenkins之后,将包括代码和依赖项在内的所有内容打包到war / jar文件中。 Even dockerfile contains application's source code and dependencies. 甚至dockerfile都包含应用程序的源代码和依赖项。 Now if we are using the docker container to deploy onto production server. 现在,如果我们使用docker容器部署到生产服务器上。 Now where do we use the war file that is generated from JEnkins? 现在,我们在哪里使用从JEnkins生成的war文件? someone please clarify. 有人请澄清。

So lets take Jenkins itself as an example. 让我们以詹金斯本身为例。 you can download jenkins.war but still you need a place to host this war file so you can use docker for that. 您可以下载jenkins.war,但仍然需要一个托管该war文件的位置,因此您可以使用docker。 think of it as an alternative for virtual machines. 可以将其视为虚拟机的替代方案。

So the jar file that you have generated through jenkins build needs java or tomcat or whatever external dependencies to be up and running docker can do that for you. 因此,您通过jenkins构建生成的jar文件需要java或tomcat或任何外部依赖项来启动,而运行docker可以为您完成此任务。 Take a look at the following example: 看下面的例子:

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

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