Jenkins Setup with Docker
Prakash Pun - January 26, 2023
• 2 min read
Jenkins Installation via Docker: A Step-by-Step Guide
Installation via
Run the following commands in your terminal to install and set up Jenkins using Docker:
Copied!docker --version # Check Docker version docker pull jenkins/jenkins:lts # Pull the latest stable Jenkins image docker images # List downloaded Docker images docker run --detach --publish 8090:8080 --volume jenkins_home:/var/jenkins_home --name jenkins jenkins/jenkins:lts # Run Jenkins on localhost:8090 docker run -u 0 -d --net=host -v /home/jenkins/home:/var/jenkins_home -v /home/jenkins/root:/root jenkins/jenkins # Optional alternative setup
Accessing Jenkins and Retrieving Initial Admin Password
After running the container, retrieve the initial admin password using the command below:
Copied!docker exec jenkins cat /var/jenkins_home/secrets/initialAdminPassword # Retrieve initial admin password
Open your browser and go to
, then enter the initial admin password to complete the setup.Understanding Key Jenkins Concepts
Project or Job
- A user-configured task that Jenkins will manage.
Build
- A single execution of a project.
Build Step
- An individual task within a project.
Build Trigger
- Defines how and when a build starts (manual or automated).
Plugins
- Extend Jenkins' core functionality to meet custom requirements.
By following this guide, you can quickly set up Jenkins using Docker and start automating your development workflows. Keep exploring Jenkins features and plugins to optimize your CI/CD processes!