Run Jenkins in Docker Container - Jenkins Pipeline Tutorial for Beginners 1/4
Key Takeaways
This video demonstrates how to set up Jenkins from scratch in a Docker container, covering topics such as pulling the Jenkins image, running the container, initializing Jenkins, and installing default plugins. The video also introduces the basics of Jenkins pipelines and project types, including freestyle and pipeline projects.
Full Transcript
so in this video we're gonna set up Jenkins from scratch in a docker container then we're gonna create a multi branch pipeline and connected with a git repository during this step I will also explain how to create different types of credentials in Jenkins and finally I will show you the basics of a Jenkins file to configure this multi branch pipeline so step one is to run Jenkins in a docker container so to use that we need to find an official image for Jenkins on docker hub so let's go and as you see here Jenkins results in an official image and some other images and if you click here you see that this image the official image has been deprecated and the last version is 2.6 T which is very old Jenkins version and instead of it we're gonna use this image here so that would be actually this one because this one is now officially maintained by the Jenkins community and also if you see the text the latest image actually has Jenkins version of to point 219 which for most of the plugins it's important to have a higher Jenkins version otherwise they can't be installed so we're going to take this image and this name of the image so on my command line I'm gonna execute docker run using this image right so I'm gonna dock run and the image however before I run this I need to add some options like I need to expose the port so that I can access it from my browser etc so let's actually go back and see the documentation of how to run this so all the explanation is here so these are some of the options that we're gonna use and actually let's go and do it so first one is I'm gonna expose the ports and the first part I'm gonna expose is port 8080 the Jenkins application inside container will run it port 8080 because Jenkins runs on Tomcat which by default starts at this port and I'm gonna bind it to my hosts port 8080 another port we can expose is 50,000 which is basically a port where drink is master and slave communicate so this will enable my Jenkins to find slaves in case I had some so the ports are open now another thing I'm gonna do is I'm gonna run it in detach mode and I'm also gonna bind volumes to it so to do that I'm gonna use minus B and I'm gonna use a named volume which I'm gonna call Jenkins home meaning I don't have to have this as a folder it's gonna be automatically created I'm just giving it a name which can be whatever you want and I'm gonna bind it to directory inside Jenkins container drink its image under slash bar slash Junkins hope this director is real and it's inside of docker container and this will create automatically create a volume now you have to be careful here because if you were to use a host volume here which basically means that you take an already existing directory on your laptop machine and binding it to the Jenkins container you might get some permission issues meaning the Jenkins user might not be able to write to that folder and that could be a problem you can actually check out my video which I made about docker volumes where you can learn in more detail how this works and the reason why we need to create a volume for Jenkins is to have data persistency for Jenkins so when we remove the container and restarted recreated the data will still be there and the reason why we need to persist this data is because all the Jenkins builds all the configuration and all the Jenkins plugins and also Jenkins users will be stored there so without this data you will basically have to reinitialize the whole Jenkins so important part here and we're gonna use the latest take of Jenkins and these are all the options we need so I'm gonna correct this one here look at here and I'm gonna run this and it's pulling the image from the docker hub it's gonna start in just couple of seconds so the image has been pulled and the docker container must be running already so if I do docker PS I see my Jenkins container running and we actually need its locks so I'm gonna do docker locks with the container ID and I'm gonna see that Jenkins started and its initial setup is needed and this is the password I'm gonna need to initialize it so I'm gonna copy that and if I go to localhost 8080 I will paste that password and it should start initializing so I'm going to go with the suggested plugins and this is gonna take some time to install all the plugins so depends on what technologies your application uses or what source management tools etc he will need different plugins for Jenkins and I'm just gonna go with the community one suggested ones and later of course in Jenkins you can manage these plugins you can delete them you can add new ones etc this is just the base so now that it's done I'm gonna create the first admin user let's go at Jenkins user some password really interesting I'm gonna just mine and I'm gonna leave it localhost Jenkins is ready and this is view I get so if I go to new item because I installed all these plugins I see different types of Jenkins projects I can create but default usually have the freestyle project freestyle project is used for simple single tasks like if you want to just run tests for example whereas with pipeline you can configure the whole delivery flow like test build package deploy your application etc pipeline is a more recent addition so before that they would just chain multiple freestyle projects to get a pipeline like project the pipeline project type is just for a single branch but in this video we're going to create a multi branch pipeline which will apply to multiple branches of the same repository and if I go to manage Jenkins that's where you as an admin user have all the tools to configure Jenkins and under manage plugins you can actually add or delete or manage or update the plugins that you have so in available I have all the plugins that I could install in addition to my Jenkins and install I have all the ones that I have actually selected at the beginning you can remove them again or you can add new plugins in the next section of this video I'm gonna show you how to create a multi branch pipeline and how to connect it to your kid repository and how to build your project using that pipeline
Original Description
Learn how to run Jenkins in a Docker Container.
This video covers the following:
* Pull Jenkins Image and run container
* Initialize Jenkins and install default plugins
* Create First Admin User
* Types of Jenkins Projects
For any questions/issues/feedback, please leave me a comment and I will get back to you as soon as possible.
#devops #jenkins #docker #techworldwithnana
-------------------------------------------------------------------------------------------------------
Complete Docker and Kubernetes tutorial ► https://bit.ly/2YGeRp9
What is Kubernetes? ► https://youtu.be/VnvRFRk_51k
Docker 🐳 vs Kubernetes ► https://youtu.be/9_s3h_GVzZc
Complete Jenkins Pipeline Tutorial ► https://youtu.be/7KCS70sCoK0
-----------------------------------------------------------------------------------
✅ Connect with me
► Youtube: https://www.youtube.com/channel/UCdngmbVKX1Tgre699-XLlUA
► DEV: https://dev.to/techworld_with_nana
► Instagram: https://www.instagram.com/techworld_with_nana/
► Twitter: https://twitter.com/Njuchi_/
Watch on YouTube ↗
(saves to browser)
Sign in to unlock AI tutor explanation · ⚡30
Playlist
Uploads from TechWorld with Nana · TechWorld with Nana · 24 of 60
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
▶
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
What is Docker? Docker container concept explained || Docker Tutorial 1
TechWorld with Nana
What is a Docker Container? Docker Demo || Docker Tutorial 2
TechWorld with Nana
How to install docker? Step by Step || Docker Tutorial 3
TechWorld with Nana
8 Basic Docker Commands || Docker Tutorial 4
TechWorld with Nana
Debugging Docker Containers with docker exec and docker logs || Docker Tutorial 5
TechWorld with Nana
Docker vs Virtual Machine | simply explained || Docker Tutorial 6
TechWorld with Nana
Overview of Workflow with Docker - Docker in Practice || Docker Tutorial 7
TechWorld with Nana
Developing with Docker - Docker in Practice || Docker Tutorial 8
TechWorld with Nana
Docker Compose Tutorial - Docker in Practice || Docker Tutorial 9
TechWorld with Nana
Dockerfile Tutorial - Docker in Practice || Docker Tutorial 10
TechWorld with Nana
Private Repository explained | Registry on AWS - Docker in Practice || Docker Tutorial 11
TechWorld with Nana
Docker Volumes explained in 6 minutes
TechWorld with Nana
Deploying the containerized application with Docker Compose || Docker Tutorial 12
TechWorld with Nana
Docker Volumes Demo || Docker Tutorial 13
TechWorld with Nana
Docker vs Kubernetes vs Docker Swarm | Comparison in 5 mins
TechWorld with Nana
What is Kubernetes | Kubernetes explained in 15 mins
TechWorld with Nana
Kubernetes Components explained! Pods, Services, Secrets, ConfigMap | Kubernetes Tutorial 14
TechWorld with Nana
Kubernetes Architecture explained | Kubernetes Tutorial 15
TechWorld with Nana
Benefits of Kubernetes | Scalability, High Availability, Disaster Recovery | Kubernetes Tutorial 16
TechWorld with Nana
Minikube and Kubectl explained | Setup for Beginners | Kubernetes Tutorial 17
TechWorld with Nana
Top 3 programming languages to learn in 2020 | meta analysis
TechWorld with Nana
Kubectl Basic Commands - Create and Debug Pod in a Minikube cluster | Kubernetes Tutorial 18
TechWorld with Nana
Kubernetes YAML File Explained - Deployment and Service | Kubernetes Tutorial 19
TechWorld with Nana
Run Jenkins in Docker Container - Jenkins Pipeline Tutorial for Beginners 1/4
TechWorld with Nana
Create Multibranch Pipeline with Git - Jenkins Pipeline Tutorial for Beginners 2/4
TechWorld with Nana
Jenkinsfile - Jenkins Pipeline Tutorial for Beginners 3/4
TechWorld with Nana
Trigger Jenkins Build automatically - Jenkins Pipeline Tutorial for Beginners 4/4
TechWorld with Nana
Complete Application Deployment using Kubernetes Components | Kubernetes Tutorial 20
TechWorld with Nana
Kubernetes Namespaces Explained in 15 mins | Kubernetes Tutorial 21
TechWorld with Nana
Configure Build Tools in Jenkins and Jenkinsfile | Jenkins Tutorial
TechWorld with Nana
Complete Jenkins Pipeline Tutorial | Jenkinsfile explained
TechWorld with Nana
Kubernetes Ingress Tutorial for Beginners | simply explained | Kubernetes Tutorial 22
TechWorld with Nana
What is Helm in Kubernetes? Helm and Helm Charts explained | Kubernetes Tutorial 23
TechWorld with Nana
How Websites Work | simply explained with examples
TechWorld with Nana
What is JavaScript? | JavaScript Tutorial #1
TechWorld with Nana
What is Ansible | Ansible Playbook explained | Ansible Tutorial for Beginners
TechWorld with Nana
JavaScript Variables & JavaScript Data Types explained | JavaScript Tutorial #2
TechWorld with Nana
How Prometheus Monitoring works | Prometheus Architecture explained
TechWorld with Nana
Where to write JavaScript | Where to execute JavaScript Code | JavaScript Tutorial #3
TechWorld with Nana
JavaScript Operators & JavaScript Conditionals | JavaScript Tutorial #4
TechWorld with Nana
Pods and Containers - Kubernetes Networking | Container Communication inside the Pod
TechWorld with Nana
Kubernetes Volumes explained | Persistent Volume, Persistent Volume Claim & Storage Class
TechWorld with Nana
Kubernetes ConfigMap and Secret as Kubernetes Volumes | Demo
TechWorld with Nana
Pull Image from Private Docker Registry in Kubernetes cluster | Demo
TechWorld with Nana
Kubernetes StatefulSet simply explained | Deployment vs StatefulSet
TechWorld with Nana
Yaml Tutorial | Learn YAML in 18 mins
TechWorld with Nana
Terraform explained in 15 mins | Terraform Tutorial for Beginners
TechWorld with Nana
Setup Prometheus Monitoring on Kubernetes using Helm and Prometheus Operator | Part 1
TechWorld with Nana
Managed Kubernetes Cluster explained | Kubernetes on Cloud (1/2)
TechWorld with Nana
Step by Step Application Deployment on LKE using Helm | Kubernetes on Cloud (2/2)
TechWorld with Nana
Kubernetes Operator simply explained in 10 mins
TechWorld with Nana
What is Infrastructure as Code? Difference of Infrastructure as Code Tools
TechWorld with Nana
AWS EKS - Create Kubernetes cluster on Amazon EKS | the easy way
TechWorld with Nana
Prometheus Monitoring - Steps to monitor third-party apps using Prometheus Exporter | Part 2
TechWorld with Nana
GitHub Actions Tutorial - Basic Concepts and CI/CD Pipeline with Docker
TechWorld with Nana
Docker Tutorial for Beginners [FULL COURSE in 3 Hours]
TechWorld with Nana
Kubernetes Services explained | ClusterIP vs NodePort vs LoadBalancer vs Headless Service
TechWorld with Nana
Kubernetes Tutorial for Beginners [FULL COURSE in 4 Hours]
TechWorld with Nana
Containers on AWS Overview: ECS | EKS | Fargate | ECR
TechWorld with Nana
Kubernetes is dropping Docker support - What does it mean for YOU?
TechWorld with Nana
More on: AI Workflow Automation
View skill →
🎓
Tutor Explanation
DeepCamp AI