What are the benefits of running Jenkins in a dock container

I found quite a few blogs on how to run your Jenkins in Docker but none of them explain the benefits of this.

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

1) I want most of the configuration for the server to be versioned.

2) I need the ability to run the build server locally on my computer when I experiment with new features or configurations.

3) I want to easily configure the build server in a new environment (for example, on a local server or in a cloud environment such as AWS).

Fortunately, I have people who care about my Jenkins server, so these points are not a big deal. Are these the only reasons or are there any better arguments that I miss, such as automatic scaling and load balancing, when many assemblies are running at the same time (I suppose this would be possible with Docker )?

+8
source share
2 answers

This is the answer for Docker, what it is and what the purpose is. What is docker? Docker What is docker? and Why docker? The official Docker website also provides explanations .
A simple guide here:

Expedited delivery of your applications
Expand and scale easier
Get higher density and do more workloads
Faster deployment makes management easier

To use Jenkins , it is faster and easier to deploy / install in docker mode. Maybe you don’t need scales that are easier to display right now. And since docker is pretty lightweight, you can do more workloads.

anyway

The docking method would also bring some other problem. Generally speaking, this is an access privilege.
For example, when you need to run Docker inside Jenkins (in Docker), it gets complicated somehow. This blog will provide you with some information about this situation.

So, as always, there is no silver bullet. There is no single development either in technology or in control technology, which in itself would promise even one increase in productivity, reliability, simplicity.

The choice should be made based on a specific scenario.

+2
source

Jenkins how code

You list mainly the benefits of having Jenkins as code. This is indeed a very powerful installation, but does not necessarily require Docker.

So why is Docker the best choice for installing code in Jenkins as Code?

docker

The main reason is that Jenkins pipelines really work well with Docker. Without Docker, you need to install additional tools and add various agents to Jenkins. With a docker

  • there is no need to install additional tools, you just use images of these tools. Jenkins downloads them from the Internet for you (Docker Hub).
  • For each stage in the pipeline, you can use different images (i.e. a tool). In essence, you get "Jenkins micro agents" that only exist temporarily. Therefore, you no longer need persistent agents. This makes your Jenkins settings much cleaner.

Beginning

Some time ago, I wrote a small blog on how to get started with Jenkins and Docker , that is, create a Jenkins image for development, which can be launched and destroyed in seconds.

0
source

Source: https://habr.com/ru/post/1268672/


All Articles