After reading several articles on continuous integration of docker and Jenkins, it is found that a Jenkins is started in docker
It’s very complicated to throw Jenkins into docker, and it doesn’t have any advantages. Why do you do this?
I used to put Jenkins in docker before, but later I found that it was extremely troublesome. Because docker is suitable for applications with light dependence, applications such as Jenkins with heavy dependence are not suitable for docker at all
According to the situation of the subject, docker does not play a very important role and can be freely selected
- Use the package manager or install it manually. reference resourceshttps://jenkins.io/doc/book/g…
- Use docker. implement
docker run -p 8080:8080 -p 50000:50000 jenkins/jenkins:lts
One more word:
Container technology mainly allows each process in the operating system to enjoy the treatment of “exclusive operating system resources”. In this way, the deployment does not need to consider the environment differences, and uses a unified way to do resource mapping (PS: IP & port, file system are all resources). Docker is based on this, which is equivalent to packaging the running environment and the software itself together, copying and replacing everywhere can complete the installation and upgrade process, as if the operating system image is general, but it is lighter n times and stronger n square times.
The above is docker in my eyes. It’s too tempting for countless software people who need to develop and maintain 7 * 24-hour operation. Even if the number of machines is small, I don’t want to fiddle with it.
Back to the specific problem:
>1. It's very complicated to throw Jenkins into docker Yes, it's hard to operate unfamiliar things. Powerful tools have some side effects - complex, but docker controls them well. >2. It doesn't feel good either In your scenario, yes. But those who toss around the server-side software running 7 * 24 hours have different opinions. >3. Why do you do this? Maybe it's just because the writers of the articles can use them easily. You don't have to copy it. It's the same with package manager.
If it’s a container based CI / CD, don’t use Jenkins. Use thishttps://github.com/drone/droneIt’s not difficult to make a powerful thing, but a powerful and simple one.
A machine is nothing.
It is convenient for cluster deployment. If you need to deploy the docker image
Just open a container to start the image. There is no configuration
It doesn’t feel like putting Jenkins in the docker. The configuration of the plug-in downloaded by Jenkins is still on the host computer. If another machine pulls the Jenkins image, it still needs to re download the plug-in and configure it. Moreover, what does Jenkins need to do in the cluster?
Java application in docker itself is not very meaningful, especially for applications like Jenkins which can be started easily
Java already has the core features of docker (container, resource limitation, etc.)
However, docker is cross language and a more elegant solution. It is also a good idea to put it in docker for unified management