在 docker 容器中运行 Jenkins 有什么好处 [英] What are the advantages of running Jenkins in a docker container

查看:52
本文介绍了在 docker 容器中运行 Jenkins 有什么好处的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发现了很多关于如何在 Docker 中运行 Jenkins 的博客,但没有一个真正解释这样做的好处.

I've found quite a few blogs on how to run your Jenkins in Docker but none really explain the advantages of doing it.

这些是我发现的唯一原因:使用 Docker 的原因.

These are the only reasons I found:reasons to use Docker.

1) 我希望服务器的大部分配置都在版本控制之下.

1) I want most of the configuration for the server to be under version control.

2) 当我尝试新功能或配置时,我希望能够在我的机器上本地运行构建服务器

2) I want the ability to run the build server locally on my machine when I’m experimenting with new features or configurations

3) 我希望能够在新环境中轻松设置构建服务器(例如在本地服务器上,或在 AWS 等云环境中)

3) I want to easily be able to set up a build server in a new environment (e.g. on a local server, or in a cloud environment such as AWS)

幸运的是,我的 Jenkins 服务器有人帮我处理,所以这些点并不重要.这些是唯一的原因还是我忽略了更好的论点,例如在一次触发许多构建时自动缩放和负载平衡(我认为这可以通过 Docker 实现)?

Luckily I have people who take care of my Jenkins server for me so these points don't matter as much. Are these the only reasons or are there better arguments I'm overlooking, like automated scaling and load balancing when many builds are triggered at once (I assume this would be possible with Docker)?

推荐答案

这个答案 for Docker,它是什么,目的是什么 涵盖了 什么是 docker?为什么要使用 docker?Docker官网也提供了说明.
这里的简单指南是:

This answer for Docker, what is it and what is the purpose covered What is docker? and Why docker? Docker official site also provides an explanation.
The simple guide here is:

更快地交付您的应用程序
更轻松地部署和扩展
获得更高的密度并运行更多的工作负载
更快的部署使管理更容易

Faster delivery of your applications
Deploy and scale more easily
Get higher density and run more workloads
Faster deployment makes for easier management

对于 Jenkins 的使用,以 docker 方式部署/安装更快更容易.也许您现在不需要更轻松的比例功能.而且由于 docker 非常轻量级,所以你可以运行更多的工作负载.

For Jenkins usage, it's faster and easier to deploy/install in the docker way. Maybe you don't need the scale more easily feature right now. And since the docker is quite lightweight, so you can run more workloads.

docker 方式也会带来一些其他的问题.一般来说,就是访问权限.
就像当你需要在 Jenkins(在 Docker 中)内运行 Docker 时,它会以某种方式变得复杂.此博客 将为您提供有关这种情况的一些知识.

The docker way would also bring some other problem. Generally speaking, it's the accessing privilege.
Like when you need to run Docker inside the Jenkins(in Docker), it would become complicated somehow. This blog would provide you with some knowledge of that situation.

所以没有像往常一样的灵丹妙药.无论是技术还是管理技术都没有单一的发展,这本身就有望在生产力、可靠性和简单性方面提高一个数量级.

So there is no silver bullet as always. There is no single development, in either technology or in management technique, that by itself promises even one order-of-magnitude improvement in productivity, in reliability, in simplicity.

应根据具体场景进行选择.

The choice should be made based on the specific scenario.

这篇关于在 docker 容器中运行 Jenkins 有什么好处的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆