Docker With Jenkins#
What Is The Jenkins?#
Jenkinsis a self-contained, open source automation server which can be used to automate all sorts of tasks related to building, testing, and delivering or deploying software.Jenkinscan be installed through native system packages, Docker, or even run standalone by any machine with a Java Runtime Environment (JRE) installed.- More information
Create Jenkins Server With Docker#
- Let's create a
docker-compose.ymlthen add some scripts as below
| docker-compose.yml | |
|---|---|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | |
-
You can see we config the
docker-composewithprivilegedmode. So what is theprivilegedmode? -
Docker privileged modegrants a Docker container root capabilities to all devices on the host system. Running a container inprivileged modegives it the capabilities of its
- Then we create 2 folders named
jenkinsanddockerto sync the data from docker to our real machine.
Testing#
- Now, Let use
docker-compose upto start the server. Then you can go tolocalhost:8081to access Jenkins and setup username/password and some plugins. - When server is started up for the first time, you can get the credential in the log of jenkins container to bypass the first authentication step.
- Then you have to wait for installing recommended plugins of jenkins.
- After that you should create the first admin user.
- After setting up, now you can start using jenkins.




