0
0
Jenkinsdevops~10 mins

Installing with Docker in Jenkins - Visual Walkthrough

Choose your learning style9 modes available
Process Flow - Installing with Docker
Pull Jenkins Docker Image
Run Jenkins Container
Container Starts Jenkins Service
Access Jenkins via Browser
Complete Initial Setup
This flow shows the steps to install Jenkins using Docker: pulling the image, running the container, starting Jenkins, accessing it, and finishing setup.
Execution Sample
Jenkins
docker pull jenkins/jenkins:lts

docker run -d -p 8080:8080 -p 50000:50000 --name jenkins jenkins/jenkins:lts
Pulls the official Jenkins LTS Docker image and runs it as a container exposing ports for web and agent communication.
Process Table
StepCommandActionResult
1docker pull jenkins/jenkins:ltsDownload Jenkins image from Docker HubImage downloaded locally
2docker run -d -p 8080:8080 -p 50000:50000 --name jenkins jenkins/jenkins:ltsStart Jenkins container in detached modeContainer running, Jenkins service started
3Access http://localhost:8080Open Jenkins web interface in browserJenkins setup page loads
4Complete initial setup wizardConfigure Jenkins admin user and pluginsJenkins ready to use
💡 Setup completes after finishing the initial configuration wizard in the browser.
Status Tracker
VariableStartAfter Step 1After Step 2After Step 3Final
Jenkins ImageNot presentDownloaded locallyAvailable for containerAvailableAvailable
Jenkins ContainerNot runningNot runningRunningRunningRunning
Jenkins ServiceStoppedStoppedStarted inside containerStartedStarted
Browser AccessNoNoNoYesYes
Key Moments - 3 Insights
Why do we need to map ports 8080 and 50000 when running the Jenkins container?
Port 8080 is for accessing Jenkins web interface in the browser, and port 50000 is for Jenkins agents to communicate. Without mapping, these services won't be reachable outside the container (see execution_table step 2).
What does the '-d' flag do in the docker run command?
The '-d' flag runs the container in detached mode, meaning it runs in the background so your terminal is free for other commands (see execution_table step 2).
Why do we need to complete the initial setup in the browser?
Jenkins requires initial configuration like setting up an admin user and installing plugins before it can be used (see execution_table step 4).
Visual Quiz - 3 Questions
Test your understanding
Look at the execution table, what happens immediately after running the docker run command?
AJenkins container starts and service runs
BJenkins setup page loads in the browser
CJenkins image is downloaded
DInitial setup wizard is completed
💡 Hint
Check step 2 in the execution_table for what docker run does.
At which step do you first access Jenkins through the browser?
AStep 1
BStep 3
CStep 2
DStep 4
💡 Hint
Look at the 'Action' column in execution_table to find when browser access happens.
If you omit the port mapping '-p 8080:8080' in the docker run command, what will happen?
AJenkins will still be accessible on port 8080
BJenkins container will fail to start
CYou won't be able to access Jenkins web interface from your browser
DJenkins will use a random port automatically
💡 Hint
Refer to variable_tracker for Browser Access and port mapping importance.
Concept Snapshot
Install Jenkins with Docker:
1. Pull image: docker pull jenkins/jenkins:lts
2. Run container: docker run -d -p 8080:8080 -p 50000:50000 --name jenkins jenkins/jenkins:lts
3. Access Jenkins at http://localhost:8080
4. Complete setup wizard
Ports 8080 and 50000 must be mapped for web UI and agent communication.
Full Transcript
To install Jenkins using Docker, first pull the official Jenkins LTS image with 'docker pull jenkins/jenkins:lts'. Then run it as a container in detached mode with ports 8080 and 50000 mapped using 'docker run -d -p 8080:8080 -p 50000:50000 --name jenkins jenkins/jenkins:lts'. This starts Jenkins inside the container. Next, open a browser and go to http://localhost:8080 to access the Jenkins web interface. Finally, complete the initial setup wizard to configure Jenkins for use. Mapping ports is essential to access Jenkins and allow agent communication. The '-d' flag runs the container in the background so your terminal stays free. The process ends after finishing the setup wizard in the browser.