Jenkins Setup with Docker
Prakash Pun - January 26, 2023
• 2 min read
Prakash Pun - January 26, 2023
• 2 min read
Run the following commands in your terminal to install and set up Jenkins using Docker:
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
After running the container, retrieve the initial admin password using the command below:
docker exec jenkins cat /var/jenkins_home/secrets/initialAdminPassword # Retrieve initial admin password
Open your browser and go to localhost:8080, then enter the initial admin password to complete the setup.
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!