Docker With Jenkins#
What Is The Jenkins?#
Jenkins
is 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.Jenkins
can 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.yml
then 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-compose
withprivileged
mode. So what is theprivileged
mode? -
Docker privileged mode
grants a Docker container root capabilities to all devices on the host system. Running a container inprivileged mode
gives it the capabilities of its
- Then we create 2 folders named
jenkins
anddocker
to sync the data from docker to our real machine.
Testing#
- Now, Let use
docker-compose up
to start the server. Then you can go tolocalhost:8081
to 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.