运行 将应用程序作为服务或将其部署在容器上有什么区别?

What is the difference between running an application as a service or deploying it on a container?

我需要为我们的持续交付策略安装以下应用程序:

JenkinsApache Archiva

但他们提供:

作为 windows 服务安装部署在容器中(即Tomcat)

我想知道将这些应用程序安装为服务是否会给我们带来更好的性能、可靠性、安全性或其他任何东西,或者相反,或者什么都没有

谢谢!

来自 Windows 上的 official documentation for installing Jenkins

If you're running on Windows it is good to run Jenkins as a service so it starts up automatically without requiring a user to log in. The easiest way is to run the Windows installer, linked from Jenkins' homepage. This also has the advantage of being easier to automate.

如果您将 Jenkins 部署到 Tomcat,那么每次启动计算机时,您可能都必须手动启动 Tomcat。此外,如果您想停止或暂停容器中的 Jenkins 运行,您可能必须手动关闭容器。如果处理不当,这可能会导致问题。

另一方面,如果 Jenkins 运行 作为一项服务,那么 Windows 将为您处理大部分这些事情。除非您需要对 Jenkins 进行非常精细的粒度控制,否则我会将其保留为服务。您 可能 想要在 Tomcat 中部署它的一个示例是,如果您编写了一个自定义插件并想要测试它。